From b37beb30d3ff9cda362365dc97aacb7dbcd48f63 Mon Sep 17 00:00:00 2001 From: Brian Scholer Date: Sun, 9 Jul 2017 16:11:51 -0400 Subject: [PATCH 1/4] Update definitions for WhatIf output #14 --- Data/Definitions.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Definitions.psd1 b/Data/Definitions.psd1 index 3fab274..e5fc560 100644 --- a/Data/Definitions.psd1 +++ b/Data/Definitions.psd1 @@ -22,7 +22,7 @@ param( ) ${Snippet_Parameterizerator} - if (`$PSCmdlet.ShouldProcess('${Verb}', '${Resource} DSC Resource')) { + if (`$PSCmdlet.ShouldProcess('${Resource} DSC Resource', '${Verb}')) { Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$VerbosePreference } } From 3935bfd5f97eabb5ec9284da2e2b03032fead506 Mon Sep 17 00:00:00 2001 From: Brian Scholer Date: Sun, 9 Jul 2017 16:18:54 -0400 Subject: [PATCH 2/4] Update definitions for terser Verbose output #11 --- Data/Definitions.psd1 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Data/Definitions.psd1 b/Data/Definitions.psd1 index e5fc560..e880210 100644 --- a/Data/Definitions.psd1 +++ b/Data/Definitions.psd1 @@ -23,7 +23,13 @@ param( ${Snippet_Parameterizerator} if (`$PSCmdlet.ShouldProcess('${Resource} DSC Resource', '${Verb}')) { - Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$VerbosePreference + + `$oldVerbosePreference = `$VerbosePreference + `$VerbosePreference = [System.Management.Automation.ActionPreference]::SilentlyContinue + + Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$oldVerbosePreference + + `$VerbosePreference = `$oldVerbosePreference } } '@ @@ -36,7 +42,12 @@ param( ) ${Snippet_Parameterizerator} - Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$VerbosePreference + `$oldVerbosePreference = `$VerbosePreference + `$VerbosePreference = [System.Management.Automation.ActionPreference]::SilentlyContinue + + Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$oldVerbosePreference + + `$VerbosePreference = `$oldVerbosePreference } '@ @@ -49,7 +60,12 @@ param( ) ${Snippet_Parameterizerator} - Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$VerbosePreference + `$oldVerbosePreference = `$VerbosePreference + `$VerbosePreference = [System.Management.Automation.ActionPreference]::SilentlyContinue + + Invoke-DscResource -Name '${Resource}' -ModuleName '${ModuleName}' -Method '${Verb}' -Property `$params -Verbose:`$oldVerbosePreference + + `$VerbosePreference = `$oldVerbosePreference } '@ From 03deca40f5e550ca3bcf78c626254d9e37bb5e7b Mon Sep 17 00:00:00 2001 From: Brian Scholer Date: Sun, 9 Jul 2017 16:31:04 -0400 Subject: [PATCH 3/4] Fix single quote escapsim in New-ParameterFromResourcePropertyInfo #12 --- Private/New-ParameterFromResourcePropertyInfo.Tests.ps1 | 1 + Private/New-ParameterFromResourcePropertyInfo.ps1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Private/New-ParameterFromResourcePropertyInfo.Tests.ps1 b/Private/New-ParameterFromResourcePropertyInfo.Tests.ps1 index b0cd9f2..ccff4e2 100644 --- a/Private/New-ParameterFromResourcePropertyInfo.Tests.ps1 +++ b/Private/New-ParameterFromResourcePropertyInfo.Tests.ps1 @@ -13,6 +13,7 @@ InModuleScope $Module.Name { 'Present' ,'Absent' ,"Single ' Quote" + ,"Weird ’ Quote" ) } $testNoSet = [PSCustomObject]@{ diff --git a/Private/New-ParameterFromResourcePropertyInfo.ps1 b/Private/New-ParameterFromResourcePropertyInfo.ps1 index 95c2204..bd89e87 100644 --- a/Private/New-ParameterFromResourcePropertyInfo.ps1 +++ b/Private/New-ParameterFromResourcePropertyInfo.ps1 @@ -46,7 +46,7 @@ param( Process { $valset = if (-not $NoValidateSet -and $Values.Count) { $set = $Values.ForEach( { - $escaped = $_.Replace("'" , "''") + $escaped = [System.Management.Automation.Language.CodeGeneration]::EscapeSingleQuotedStringContent($_) "'$escaped'" } ) -join ',' "[ValidateSet($set)]" From 78545278394401c7b2ee474ceca95d8f638ca28c Mon Sep 17 00:00:00 2001 From: Brian Scholer Date: Sun, 9 Jul 2017 18:05:11 -0400 Subject: [PATCH 4/4] Update version to 1.0.2.0 in manifest --- Idempotion.psd1 | Bin 7908 -> 7908 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Idempotion.psd1 b/Idempotion.psd1 index 0a9a0d07d820bd4a6026e1da1526a6fa0178cc39..cc3df0c9d3826c053a447858876775c2dfc34354 100644 GIT binary patch delta 14 VcmaE2`^0vG0TZLqW<#dUG5{=$1q}cI delta 14 VcmaE2`^0vG0TZL)W<#dUG5{=w1q=WH