/PowerShell-Pre-Workout

My mix of tools (and experiments) to help jump start your PowerShell session!

Primary LanguagePowerShellMIT LicenseMIT

PowerShell Pre-Workout

A special mix of tools (and experiments) to help jump start your PowerShell session!

An image generated by Bing Image Creator. Prompt: hooded robot hacker wearing a PowerShell shirt, drinking a powerful energy drink with energy swirling around the cup, surrounded by swirling energy, floating in the air, cinematic, hacker professional photography, studio lighting, studio background, advertising photography, intricate details, hyper-detailed, ultra realistic, 8K UHD, PowerShell

Contents

Script Description
New-ProfileWorkspace Setup a folder and VS Code Workspace for maintaining your PowerShell profiles, VS Code settings, and Windows Terminal settings.
New-DotSourcedProfile Point all of your CurrentUserHost PowerShell profiles to a central dot sourced profile.
Install-OhMyPosh Install Oh My Posh with Nerd Fonts to make your shell beautiful and functional.
Install-PowerShellISE Reinstall the PowerShell ISE for compatibility testing. 😉
Get-EnvironmentVariable Easily get one or all environment variables.
Set-EnvironmentVariable Easily set an environment variables.
Get-MsModules Get a list of Microsoft's core modules for Azure, Graph, and M365.
Install-MsModules Get a list of Microsoft's core modules for Azure, Graph, and M365.
Update-MsModules A helper for updating Microsoft's core modules for Azure, Graph, and M365.
Get-RecommendedModules Get a list of community recommended modules.
Install-RecommendedModules Easily install optional recommended modules.

Script Details

$~$

New-ProfileWorkspace 🔝

Synopsis

Setup a folder and VS Code Workspace for maintaining your PowerShell profiles, VS Code settings, and Windows Terminal settings.

Description

I wanted an easy way to maintain all of my CurrentUser PowerShell profiles, and my settings files for Visual Studio Code and Windows Terminal. There are probably easier ways to accomplish this, but my basic goal was to not have to hunt for these files across the file system in order to edit them. This admittedly over-engineered idea creates a folder that contains:

  • Junction points to the locations of your CurrentUser PowerShell and Windows PowerShell folders
  • Junction points to the locations of your settings for VS Code and Windows Terminal
  • Structural artifacts in case you want to save this as a repository
    • A Visual Studio Code workspace file that opens this new folder
    • EditorConfig and Visual Studio Code settings files for consistent editing
    • A .gitignore file in case you want to use this as a git repository (test?)

$~$

New-DotSourcedProfile 🔝

I need to automate this one still, but it will be a script that creates one central profile script and then sets each CurrentUser profile to dot source that central profile for easier sync across all of your profiles for PowerShell, PowerShell ISE, Visual Studio Code, Windows PowerShell, etc.

$~$

Install-OhMyPosh 🔝

Synopsis

Install Oh My Posh, or update it if already installed.

Description

This is a quick installer for Oh My Posh. It's almost unnecessary because of how easy OMP is to install, but may be helpful to people who are brand new to it and want to save time. Includes steps to install Nerd Fonts. Nerd Fonts are required to get the most out of Oh My Posh and some great modules like Posh-Git, and Terminal Icons.

$~$

Install-PowerShellISE 🔝

Install the PowerShell ISE if it was removed. It can be helpful to keep the ISE installed for compatibility testing.

$~$

Get-EnvironmentVariable 🔝

Easily get a specific environment variable or list all of them.

$~$

Set-EnvironmentVariable 🔝

Set an environment variable.

$~$

Get-MsModules 🔝

List all of the Microsoft PowerShell modules that you need for working with Azure, Microsoft 365, or Microsoft Graph.

$~$

Install-MsModules 🔝

Quickly install all or any of the Microsoft PowerShell modules that you need for working with Azure, Microsoft 365, or Microsoft Graph.

$~$

Update-MsModules 🔝

Quickly update all or any of the Microsoft PowerShell modules that you need for working with Azure, Microsoft 365, or Microsoft Graph.

$~$

Get-RecommendedModules 🔝

Get a list of recommended PowerShell modules authored by Microsoft and the community.

$~$

Install-RecommendedModules 🔝

Install your choice of recommended PowerShell modules authored by Microsoft and the community.