Add parameter option to :ps (poweshell) function

Shawn 2 years ago updated 2 years ago 0

I've been playing with the new :ps function and it's great, but I find that I need to create several scripts where one might be sufficient if the :ps function supported variable input that can be parsed with param(). This could work as:




These could be parsed with the following in your powershell script variable:

    param (
        [string]$param1 = "https",
        [string]$param2 = "5"

Values in square brackets (or some other acceptable predefined syntax) would be replaced with the values of the existing variable.

This would greatly increase the utility of the :ps function.