Use more simple check for existence of member
This commit is contained in:
parent
14dab9870b
commit
6cda35e1d3
4 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue