PowerShell – Expand-Aliases

#Requires -Version 3 function Expand-Aliases { <# .SYNOPSIS find any aliases in use and expand them to full cmdlet names. .DESCRIPTION Any scripts in ‘corporate’ or ‘formal’ use should have any aliases expanded. This removes ambiguity and any potential clashes or errors. .PARAMETER InputFiles The powershell .ps1 file(s) you wish to scan/repair for aliases. .EXAMPLE…

3

Windows – BeatUp-Windows – stress memory and cpu’s

# BeatUp-Windows.ps1 # $psProcess = gps -id $PID $psInstances = (gps -Name $psProcess.name).count if ($psInstances -gt 1) { $psName = “{0}#{1}” -f $psProcess.name,$($psInstances – 1) } else { $psName = $psProcess.name } # RAM in box $box=get-WMIobject Win32_ComputerSystem $Global:physMB=$box.TotalPhysicalMemory / 1024 /1024 ##################### # perfmon counters $Global:psPerfCPU = new-object System.Diagnostics.PerformanceCounter(“Processor”,”% Processor Time”,”_Total”) $Global:psPerfMEM = new-object…

1