Skip to content

Instantly share code, notes, and snippets.

Dave Wilson davewilson

Block or report user

Report or block davewilson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
davewilson / Kaizen.ps1
Last active Aug 29, 2015
PowerShell Kaizen
View Kaizen.ps1
# Source: http://jdhitsolutions.com/blog/essential-powershell-resources/
Get-Command -Module Microsoft*,Cim*,PS*,ISE | Get-Random | Get-Help -ShowWindow
Get-Random -input (Get-Help about*) | Get-Help -ShowWindow
@davewilson
davewilson / pathmanip.ps1
Last active Aug 29, 2015
Useful Path Manipulation Shortcuts
View pathmanip.ps1
#http://powershell.com/cs/blogs/tips/archive/2014/09/08/useful-path-manipulation-shortcuts.aspx
[System.IO.Path]::GetFileNameWithoutExtension('file.ps1')
[System.IO.Path]::GetExtension('file.ps1')
[System.IO.Path]::ChangeExtension('file.ps1', '.copy.ps1')
[System.IO.Path]::GetFileNameWithoutExtension('c:\test\file.ps1')
[System.IO.Path]::GetExtension('c:\test\file.ps1')
[System.IO.Path]::ChangeExtension('c:\test\file.ps1', '.bak')
@davewilson
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
davewilson / emailloggedinusers.ps1
Created Jul 10, 2014
Email list of logged in users
View emailloggedinusers.ps1
#get usernames and email
#from http://www.reddit.com/r/PowerShell/comments/2acnqh/computerlist_filter_by_user/
$MachineList = Get-Content -Path H:\ListOfMachines.txt; # One system name per line
foreach ($machine in $MachineList){
$params = @{'ComputerName'=$machine;
'Namespace'='root\cimv2';
'Class'='Win32_ComputerSystem';
'ErrorAction'='SilentlyContinue'
}
$user = (Get-WmiObject @params).UserName
View Get-FullURL.ps1
<#
.Synopsis
Expands a shortened URL to its full URL
.DESCRIPTION
Expands a shortened URL to its full URL
.EXAMPLE
Get-FullURL http:/bit.ly/12345
#>
function Get-FullURL
{
@davewilson
davewilson / CommonShare.ps1
Last active Feb 10, 2017
Mounts and Dismounts commonly used network shares
View CommonShare.ps1
<#
.Synopsis
Maps commonly used network shares
.DESCRIPTION
Maps drives for commonly used network shares. Username parameter will map the drives as a specific user
.EXAMPLE
Mount-CommonShare
.EXAMPLE
Mount-CommonShare -Username stcxyz
#>
View Get-EventLogAudit.ps1
Function Get-EventLogAudit {
param (
$whichLog,
[datetime]$start,
[datetime]$end
)
$totalDays = ($end - $start).Days
$randomDay = $start.AddDays((Get-Random $totalDays))
$randomDayHour = $randomDay.AddHours((Get-Random 24))
@davewilson
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
[System.Console]::Beep(587.3,200)
[System.Console]::Beep(1174.7,200)
[System.Console]::Beep(880,200)
[System.Console]::Beep(784,200)
[System.Console]::Beep(1568,200)
[System.Console]::Beep(880,200)
[System.Console]::Beep(1480,200)
[System.Console]::Beep(880,200)
@davewilson
davewilson / Play-Mario.ps1
Last active Jan 6, 2019
Super Mario Theme in PowerShell
View Play-Mario.ps1
Function Play-Mario {
[System.Console]::Beep(659, 125);
[System.Console]::Beep(659, 125);
[System.Threading.Thread]::Sleep(125);
[System.Console]::Beep(659, 125);
[System.Threading.Thread]::Sleep(167);
[System.Console]::Beep(523, 125);
[System.Console]::Beep(659, 125);
[System.Threading.Thread]::Sleep(125);
[System.Console]::Beep(784, 125);
You can’t perform that action at this time.