Skip to content

Commit

Permalink
CmdletBinding SupportsShouldProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
lexiismadd committed Nov 24, 2022
1 parent 455aaac commit ca3ca61
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Standard-CT-Module/CT-PS-Standard.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trap {
}

function Initialize-Script {
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess)]
param()
<#
---- STANDARD SCRIPT BLOCK ----
Expand Down Expand Up @@ -140,7 +140,7 @@ function Initialize-Script {
}

Function Write-Log {
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess)]
Param(
[Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)]
$output
Expand Down Expand Up @@ -168,7 +168,7 @@ Function Write-APILog {

Function Request-Download {
# Downloads a file using BITS if possible, and if BITS is not available, downloads directly from URL
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess)]
Param(
[Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, Mandatory = $true)]
[string[]] $FILE_URL,
Expand Down Expand Up @@ -230,6 +230,9 @@ Function Request-Download {


function Get-CurrentLineNumber {
# Downloads a file using BITS if possible, and if BITS is not available, downloads directly from URL
[CmdletBinding(SupportsShouldProcess)]
param()
return "$(Get-ChildItem $MyInvocation.ScriptLineNumber)"
}

0 comments on commit ca3ca61

Please sign in to comment.