diff --git a/windows/win_stat b/windows/win_stat index 5aba801a67d..c98cd55f599 100644 --- a/windows/win_stat +++ b/windows/win_stat @@ -27,7 +27,8 @@ description: options: path: description: - - The full path of the file/object to get the facts of + - The full path of the file/object to get the facts of; both forward and + back slashes are accepted. required: true default: null aliases: [] diff --git a/windows/win_stat.ps1 b/windows/win_stat.ps1 index fa5596ec1b7..a5748a8bda0 100644 --- a/windows/win_stat.ps1 +++ b/windows/win_stat.ps1 @@ -19,16 +19,20 @@ $params = Parse-Args $args; -$path = ''; +$path = $FALSE; If ($params.path.GetType) { $path = $params.path; } +If ($path -eq $FALSE) +{ + Fail-Json (New-Object psobject) "missing required argument: path"; +} $get_md5 = $TRUE; If ($params.get_md5.GetType) { - $get_md5 = $params.get_md5; + $get_md5 = $params.get_md5 | ConvertTo-Bool; } $result = New-Object psobject @{