From a13b2dd3b38418e40b685008d1c8b5290cfa0a3f Mon Sep 17 00:00:00 2001 From: Chris Church Date: Thu, 19 Jun 2014 11:20:11 -0500 Subject: [PATCH] Add tests for win_stat module. --- windows/win_stat | 3 ++- windows/win_stat.ps1 | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 @{