Skip to content

Commit cc7e9d5

Browse files
Merge pull request #139 from PowershellFrameworkCollective/strings
strings: Adding support for Test-PSFShouldProcess
2 parents ec76234 + 7558f11 commit cc7e9d5

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

PSModuleDevelopment/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2.2.9.106 (September 10th, 2020)
44

55
- New: Convert-PSMDMessage - Converts a file's use of PSFramework messages to strings.
6+
- Upd: Export-PSMDString - Adding support for Test-PSFShouldProcess.
67
- Fix: Export-PSMDString - Failed with splatting detection
78

89
## 2.2.8.104 (July 26th, 2020)

PSModuleDevelopment/functions/refactor/Convert-PSMDMessage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127

128128
$commandAsts = $ast.FindAll({
129129
if ($args[0] -isnot [System.Management.Automation.Language.CommandAst]) { return $false }
130-
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false }
130+
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false }
131131
if (-not ($args[0].CommandElements.ParameterName -match '^Message$|^Action$')) { return $false }
132132
$true
133133
}, $true)

PSModuleDevelopment/functions/refactor/Export-PSMDString.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#region Command Parameters
4949
$commandAsts = $ast.FindAll({
5050
if ($args[0] -isnot [System.Management.Automation.Language.CommandAst]) { return $false }
51-
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false }
51+
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false }
5252
if (-not ($args[0].CommandElements.ParameterName -match '^String$|^ActionString$')) { return $false }
5353
$true
5454
}, $true)
@@ -79,7 +79,7 @@
7979
$splattedVariables = $ast.FindAll({
8080
if ($args[0] -isnot [System.Management.Automation.Language.VariableExpressionAst]) { return $false }
8181
if (-not ($args[0].Splatted -eq $true)) { return $false }
82-
try { if ($args[0].Parent.CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false } }
82+
try { if ($args[0].Parent.CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false } }
8383
catch { return $false }
8484
$true
8585
}, $true)

0 commit comments

Comments
 (0)