From f75d521cd1bbe9991690d2f53d2695c7ccacff35 Mon Sep 17 00:00:00 2001 From: Dan1el42 Date: Sat, 29 Aug 2015 18:51:52 -0600 Subject: [PATCH] Fixes #23. Added data type System.String to CheckSum parameter of Get/Set/Test-TargetResource functions and aligned indentation. --- .../MSFT_xVhdFileDirectory.psm1 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/DSCResources/MSFT_xVhdFileDirectory/MSFT_xVhdFileDirectory.psm1 b/DSCResources/MSFT_xVhdFileDirectory/MSFT_xVhdFileDirectory.psm1 index 4c87136..f4a6b93 100644 --- a/DSCResources/MSFT_xVhdFileDirectory/MSFT_xVhdFileDirectory.psm1 +++ b/DSCResources/MSFT_xVhdFileDirectory/MSFT_xVhdFileDirectory.psm1 @@ -16,8 +16,10 @@ function Get-TargetResource [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance[]] $FileDirectory, - [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] - $CheckSum = 'ModifiedDate' + + [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] + [System.String] + $CheckSum = 'ModifiedDate' ) if ( -not (Test-path $VhdPath)) @@ -80,8 +82,10 @@ function Set-TargetResource [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance[]] $FileDirectory, - [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] - $CheckSum = 'ModifiedDate' + + [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] + [System.String] + $CheckSum = 'ModifiedDate' ) if (-not (Test-Path $VhdPath)) { throw "Specified destination path $VhdPath does not exist!"} @@ -161,9 +165,10 @@ function Test-TargetResource [parameter(Mandatory = $true)] [Microsoft.Management.Infrastructure.CimInstance[]] $FileDirectory, - - [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] - $CheckSum = 'ModifiedDate' + + [ValidateSet('ModifiedDate','SHA-1','SHA-256','SHA-512')] + [System.String] + $CheckSum = 'ModifiedDate' ) # If the VHD path does not exist throw an error and stop.