Function to create context menu entries in order to invoke PowerShell
Utils\Add-PowerShellContextMenu.ps1
Add-PowerShellContextMenu [[-ContextType] <Object>] [-Platform <Object>] [-NoProfile] [-AsAdmin]
While there is already a default 'Edit' context menu entry for PowerShell ISE I wanted to have it open a specific Platform version elevated without loading profile). In addition to that I also like to add a context menu entry to open up a PowerShell command prompt from any folder or drive in Windows Explorer.
Add-PowerShellContextMenu -ContextType editWithPowerShellISE -Platform x86 -AsAdmin
Add-PowerShellContextMenu -ContextType openPowerShellHere -Platform x86 -AsAdmin
Indicates the type of context menu entry to create. Possible values are openPowerShellHere and editWithPowerShellISE
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe platform type of Powershell to create the context menu entry for. Defaults to x64.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: X64
Accept pipeline input: False
Accept wildcard characters: False{{Fill NoProfile Description}}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{Fill AsAdmin Description}}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False