Use more simple check for existence of member

This commit is contained in:
Matt Martz 2014-06-17 15:44:53 -05:00
parent fb43772429
commit 3b5c568b10
4 changed files with 6 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}