From 3b5c568b105ed9f26cae4af2326425211f6ddd99 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 17 Jun 2014 15:44:53 -0500 Subject: [PATCH] Use more simple check for existence of member --- windows/ping.ps1 | 2 +- windows/slurp.ps1 | 4 ++-- windows/stat.ps1 | 4 ++-- windows/win_ping | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/windows/ping.ps1 b/windows/ping.ps1 index ee46cfd4b86..8e5fc1f2c9e 100644 --- a/windows/ping.ps1 +++ b/windows/ping.ps1 @@ -7,7 +7,7 @@ If ($args.Length -gt 0) } $data = 'pong'; -If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'data') +If ($params.data.GetType) { $data = $params.data; } diff --git a/windows/slurp.ps1 b/windows/slurp.ps1 index 21e912f46ae..6678b9a8d84 100644 --- a/windows/slurp.ps1 +++ b/windows/slurp.ps1 @@ -8,13 +8,13 @@ If ($args.Length -gt 0) } $src = ''; -If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'src') +If ($params.src.GetType) { $src = $params.src; } Else { - If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'path') + If ($params.path.GetType) { $src = $params.path; } diff --git a/windows/stat.ps1 b/windows/stat.ps1 index 2e87b12275a..14e00d8f552 100644 --- a/windows/stat.ps1 +++ b/windows/stat.ps1 @@ -8,13 +8,13 @@ If ($args.Length -gt 0) } $path = ''; -If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'path') +If ($params.path.GetType) { $path = $params.path; } $get_md5 = $TRUE; -If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'get_md5') +If ($params.get_md5.GetType) { $get_md5 = $params.get_md5; } diff --git a/windows/win_ping b/windows/win_ping index 8eba171d0ea..c8e3042dee6 100644 --- a/windows/win_ping +++ b/windows/win_ping @@ -7,7 +7,7 @@ If ($args.Length -gt 0) } $data = 'pong'; -If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'data') +If ($params.data.GetType) { $data = $params.data; }