Runs commands in Windows PowerShell (typically from PowerShell Core).
Invoke-WindowsPowerShell.ps1 [-CommandBlock] <ScriptBlock> [[-BlockArgs] <PSObject[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-WindowsPowerShell.ps1 [-CommandText] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Invoke-WindowsPowerShell.ps1 '$PSVersionTable.PSEdition'
Desktop
Invoke-WindowsPowerShell.ps1 {Param($n); Get-WmiObject Win32_Process -Filter "Name like '$n'" |foreach ProcessName} power%
PowerToys.exe PowerToys.Awake.exe PowerToys.FancyZones.exe PowerToys.KeyboardManagerEngine.exe PowerLauncher.exe powershell.exe powershell.exe
A script block to run.
Type: ScriptBlock
Parameter Sets: CommandBlock
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Parameters to the script block.
Type: PSObject[]
Parameter Sets: CommandBlock
Aliases:
Required: False
Position: 2
Default value: @()
Accept pipeline input: False
Accept wildcard characters: False
The text of the command to run.
Type: String
Parameter Sets: CommandText
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.