From 6cda35e1d3642138c19838e86c260ceaa4656185 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 --- library/windows/ping.ps1 | 2 +- library/windows/slurp.ps1 | 4 ++-- library/windows/stat.ps1 | 4 ++-- library/windows/win_ping | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/windows/ping.ps1 b/library/windows/ping.ps1 index ee46cfd4b86..8e5fc1f2c9e 100644 --- a/library/windows/ping.ps1 +++ b/library/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/library/windows/slurp.ps1 b/library/windows/slurp.ps1 index 21e912f46ae..6678b9a8d84 100644 --- a/library/windows/slurp.ps1 +++ b/library/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/library/windows/stat.ps1 b/library/windows/stat.ps1 index 2e87b12275a..14e00d8f552 100644 --- a/library/windows/stat.ps1 +++ b/library/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/library/windows/win_ping b/library/windows/win_ping index 8eba171d0ea..c8e3042dee6 100644 --- a/library/windows/win_ping +++ b/library/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; }