Category: General

General

Display Profile Functions

If you are like me and have multiple machines you work on with different profiles, it can be difficult to remember which profile contains which functions. So, I wrote a quick function that will display all the functions for me on start up. Just add the code below to the bottom of your $profile file. Function Get-ProfileFunctions { $__ProfileFunctions =...
GeneralTools

Copy Your Profile from ISE to Visual Studio Code

# Get the path to the Profile files $ISEProfile = Join-Path (Split-Path $profile) "Microsoft.PowerShellISE_profile.ps1" $VSCProfile = Join-Path (Split-Path $profile) "Microsoft.VSCode_profile.ps1" # If the ISE Profile exists write the content to the VSCode Profile if(Test-Path $ISEProfile){ # Check if profile exists, create if it does not if(!(Test-Path $VSCProfile)){ New-Item $VSCProfile -ItemType file -Force } # write content to VSCode Profile "`n#...
FunGeneral

PowerShell Timer with Alarm

Function Start-Timer { param( [Parameter(Mandatory=$true)] [int]$seconds, [Parameter(Mandatory=$false)] [switch]$alarm ) $a = $(Get-Date) For($i=1;$i -le $seconds;$i++){ Write-Progress -Activity "$seconds Second Timer" -Status $i -PercentComplete $(($i/$seconds)*100) -id 1 Start-Sleep -Seconds 1 } if($alarm){ For($i=1;$i -le 10;$i++){ [console]::beep(500,300) } } }