Answers for "PowerShell script block"

0

PowerShell script block

# How to create your own Invoke commandlet function

function Invoke-MyOwnCommand {
	param (
    	[System.Management.Automation.ScriptBlock]$ScriptBlock = $null
    )
    &$ScriptBlock
}

# Usage
Invoke-MyOwnCommand -ScriptBlock {Get-Process}
Posted by: Guest on May-04-2022

Code answers related to "PowerShell script block"

Browse Popular Code Answers by Language