Skip to content

Instantly share code, notes, and snippets.

View Find-PST.ps1
$outputfilepath = "C:\Located-PST.csv"
$searchpath = "SEARTH_PATH"
Get-ChildItem -Force $searchpath -include *.pst -Recurse | Where-Object { ($_.PSIsContainer -eq $false) } | Select-Object Name,Directory,Length | Export-Csv $outputfilepath -NoTypeInformation
davewilson / Kaizen.ps1
Last active Aug 29, 2015
PowerShell Kaizen
View Kaizen.ps1
# Source:
Get-Command -Module Microsoft*,Cim*,PS*,ISE | Get-Random | Get-Help -ShowWindow
Get-Random -input (Get-Help about*) | Get-Help -ShowWindow
davewilson / pathmanip.ps1
Last active Aug 29, 2015
Useful Path Manipulation Shortcuts
View pathmanip.ps1
[System.IO.Path]::ChangeExtension('file.ps1', '.copy.ps1')
[System.IO.Path]::ChangeExtension('c:\test\file.ps1', '.bak')
davewilson / gist:a66f2b084ffbaae5bc80
Created Aug 19, 2014
Install .NET 3.5 on Windows 8.1
View gist:a66f2b084ffbaae5bc80
Fix error code 0x800F0906 when trying to install .NET 3.5 on Windows 8.1
dism /online /enable-feature /featurename:NetFx3 /all /source:d:\sources\sxs /limitaccess
davewilson / emailloggedinusers.ps1
Created Jul 10, 2014
Email list of logged in users
View emailloggedinusers.ps1
#get usernames and email
$MachineList = Get-Content -Path H:\ListOfMachines.txt; # One system name per line
foreach ($machine in $MachineList){
$params = @{'ComputerName'=$machine;
$user = (Get-WmiObject @params).UserName
View Get-FullURL.ps1
Expands a shortened URL to its full URL
Expands a shortened URL to its full URL
Get-FullURL http:/
function Get-FullURL
davewilson / CommonShare.ps1
Last active Feb 10, 2017
Mounts and Dismounts commonly used network shares
View CommonShare.ps1
Maps commonly used network shares
Maps drives for commonly used network shares. Username parameter will map the drives as a specific user
Mount-CommonShare -Username stcxyz
View Get-EventLogAudit.ps1
Function Get-EventLogAudit {
param (
$totalDays = ($end - $start).Days
$randomDay = $start.AddDays((Get-Random $totalDays))
$randomDayHour = $randomDay.AddHours((Get-Random 24))
davewilson / Play-SweetChildOMine.ps1
Created May 20, 2013
The opening to Sweet Child O' Mine in PowerShell
View Play-SweetChildOMine.ps1
Function Play-SweetChildOMine {
#First Stanza
davewilson / Play-Mario.ps1
Last active May 9, 2022
Super Mario Theme in PowerShell
View Play-Mario.ps1
Function Play-Mario {
[System.Console]::Beep(659, 125);
[System.Console]::Beep(659, 125);
[System.Console]::Beep(659, 125);
[System.Console]::Beep(523, 125);
[System.Console]::Beep(659, 125);
[System.Console]::Beep(784, 125);