This file contains hidden or 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-CurrentWeather { | |
#Save this function inside your Powershell Profile. Not sure what that is? Just type in $profile and hit enter in your PS Console! | |
#File doesn't exist? That's OK, use Powershell to create it! | |
#New-Item -File -Path $env:USERPROFILE\Documents\WindowsPowershell\ -Value $profile | |
#Give your script a voice! | |
Add-Type -assemblyname System.Speech | |
$speech = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
This file contains hidden or 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 | |
Automatically create transcript of your Powershell session. | |
.DESCRIPTION | |
Add this function to your Powershell Profile and call it with Invoke-SessionLog -Logpath \some\path to automatically keep | |
session history each time you open up powershell. | |
.EXAMPLE | |
Invoke-SessionLog -LogPath C:\PSLogs -DaysToKeep 7 |
This file contains hidden or 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
$Computers = Get-ADComputer -Filter * | Select Name | |
$file = /path/to/file | |
Foreach($c in $computers) { | |
#Uncomment to use UNC | |
If((Test-Path "\\$($c.Name)\C$\$file")){ | |
#uncomment to use remoting | |
#If(Invoke-Command -Computer $c.Name -Command { (Test-Path $args[0])} -ArgumentList $file){ | |
[pscustomobject]$cDetail = [ordered]@{ |
This file contains hidden or 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 New-RandomDataset { | |
<# | |
.SYNOPSIS | |
Generate random data for use in testing, demonstrations, etc. | |
.DESCRIPTION | |
Using the NameIT module, generate random data exported to a CSV file | |
.PARAMETER Count | |
The number of items in your dataset | |
.PARAMETER CSVPAth |
This file contains hidden or 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 New-LMGTFYLink { | |
<# | |
.SYNOPSIS | |
Generates a Let Me Google That For You url from entered query | |
.PARAMETER Query | |
String to be searched for | |
.EXAMPLE | |
New-LMGTFY -Query "Why is the sky blue?" |
This file contains hidden or 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 Find-Service { | |
<# | |
.SYNOPSIS | |
Find a specified service on remote endpoints | |
.PARAMETER Computername | |
The remote endpoint(s) to query | |
.PARAMETER ServiceDisplayName | |
The Display Name of the service to query |
This file contains hidden or 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 Test-VM { | |
[cmdletBinding()] | |
Param( | |
[Parameter] | |
[string] | |
$dummy | |
) | |
#Dynamic Params require [CmdletBinding()], but are defined on their own outside the main Param() block | |
DynamicParam { | |
$ParameterName = 'VM' |
This file contains hidden or 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-UserProfileSize { | |
<# | |
.SYNOPSIS | |
Gather profile sizes on a computer | |
.DESCRIPTION | |
Returns the size of a user profile on a given computername | |
.PARAMETER IncludeSpecial | |
Includes built-in accounts in the object |
This file contains hidden or 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 Send-CatFactMessage { | |
<# | |
.SYNOPSIS | |
Send a cat fact to users on a computer. | |
.DESCRIPTION | |
Send a random cat fact to any number of computers and all users or a specific user. Supports credential passing. | |
.EXAMPLE | |
Send-CatFactMessage -PlayAudio | |
Sends cat fact message to all users on localhost and outputs fact through speakers. | |
.EXAMPLE |
OlderNewer