Common PowerShell functions that I use compiled into a PowerShell Module
Common commands used regularly by me. Compiled into a PowerShell Module.
Clone this repository into one of the directories listed as your PSMODULEPATH environment variable.
Run a PowerShell console and do the following:
$modulePath = @(($env:PSMODULEPATH.Split(";")))
Write-Host $modulePath[0]
The value of $modulePath
is one of your recognized PowerShell Module directories.
cd $modulePath[0]
git clone https://github.com/infamousjoeg/CommonCommands.git
That will download all the files into a “CommonCommands” directory in the proper location.
Import-Module CommonCommands
Get-Command -Module CommonCommands
The function Load-XAMLForm
was created based on information derived from this blog post on mcpmag.com.
The function expects a xaml.xml
file to be located in the script’s working directory that contains the XAML created from Visual Studio.
The function will load in that XAML and parse it to work within PowerShell. It will then load up all elements from the XAML form code as variables to be worked with in the current PowerShell script.
The function will display the window and return the form variables in an array.
$Form.ShowDialog() | Out-Null