IT-Admin-Toolkit-WinUI icon indicating copy to clipboard operation
IT-Admin-Toolkit-WinUI copied to clipboard

Create Wrapper to Designate $PSDefaultParameterValues - PS7 Remoting, Silent Credentials, etc.

Open nkasco opened this issue 2 years ago • 0 comments

$PSDefaultParameterValues is a very powerful feature when used correctly, seeking wrapper functionality to sit between invocation click and actual script launch to enable backwards compatibility of scripts written for Windows PowerShell.

For example: WinRM Remoting by default will use PowerShell 5 in the remote session even if invoked from a PowerShell 7 session. As long as the remote endpoint has PS7 WinRM endpoint remoting enabled, you can pass -ConfigurationName as a parameter to run the remote session in PS7.

The same approach could be taken for ConfigurationName, Credential, or any other parameter that you'd like to default to improve UX.

Since many admins have already written scripts for PS5, this may help users get to the latest PS7 version faster.

Goal: Create a UI editor to allow the designation of these parameters, their argument values, and what cmdlets they should be tied to. Then provide a valve to use this wrapper on a per-script basis in the script XML.

nkasco avatar Nov 23 '22 12:11 nkasco