Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PSModuleDevelopment/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 2.2.9.106 (September 10th, 2020)

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

## 2.2.8.104 (July 26th, 2020)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

$commandAsts = $ast.FindAll({
if ($args[0] -isnot [System.Management.Automation.Language.CommandAst]) { return $false }
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false }
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false }
if (-not ($args[0].CommandElements.ParameterName -match '^Message$|^Action$')) { return $false }
$true
}, $true)
Expand Down
4 changes: 2 additions & 2 deletions PSModuleDevelopment/functions/refactor/Export-PSMDString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#region Command Parameters
$commandAsts = $ast.FindAll({
if ($args[0] -isnot [System.Management.Automation.Language.CommandAst]) { return $false }
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false }
if ($args[0].CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false }
if (-not ($args[0].CommandElements.ParameterName -match '^String$|^ActionString$')) { return $false }
$true
}, $true)
Expand Down Expand Up @@ -79,7 +79,7 @@
$splattedVariables = $ast.FindAll({
if ($args[0] -isnot [System.Management.Automation.Language.VariableExpressionAst]) { return $false }
if (-not ($args[0].Splatted -eq $true)) { return $false }
try { if ($args[0].Parent.CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$') { return $false } }
try { if ($args[0].Parent.CommandElements[0].Value -notmatch '^Invoke-PSFProtectedCommand$|^Write-PSFMessage$|^Stop-PSFFunction$|^Test-PSFShouldProcess$') { return $false } }
catch { return $false }
$true
}, $true)
Expand Down