This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |