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
#Insert a ToDo comment in an ISE script file | |
$action = { | |
$psise.CurrentFile.Editor.InsertText("# [$((Get-Date).ToShortDateString())] ToDo: ") | |
#jump cursor to the end | |
$psise.CurrentFile.editor.SetCaretPosition($psise.CurrentFile.Editor.CaretLine,$psise.CurrentFile.Editor.CaretColumn) | |
} | |
#add the action to the Add-Ons menu | |
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("ToDo",$Action,"Alt+2" ) | Out-Null |
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
#requires -version 4.0 | |
#originally from http://poshcode.org/5085 | |
Function Send-PopupMessage { | |
<# | |
.SYNOPSIS | |
Send a graphical popup message. | |
.DESCRIPTION |
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-IsPrime { | |
<# | |
.Synopsis | |
Test if a number is prime | |
.Description | |
This command will test if a given number is prime based. | |
.Example |
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
#requires -version 5.1 | |
Function Get-AVStatus { | |
<# | |
.Synopsis | |
Get anti-virus product information. | |
.Description | |
This command uses WMI via the Get-CimInstance command to query the state of installed anti-virus products. The default behavior is to only display enabled products, unless you use -All. You can query by computername or existing CIMSessions. | |
.Example |
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
<# | |
based on a comment from Matt Penny | |
function todo { | |
param ([string]$TodoText) | |
write-host -foregroundcolor DarkYellow ” [o] Todo: $TodoText” | |
} | |
Get more from Matt at https://mattypenny.net/ |
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
#Requires -version 3.0 | |
<# | |
Test-IsNanoServer.ps1 | |
**************************************************************** | |
* DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED * | |
* THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK. IF * | |
* YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, * | |
* DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING. * |
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-ISEMRU { | |
[cmdletbinding()] | |
Param() | |
<# | |
Path will be something like: | |
C:\Users\Jeff\AppData\Local\microsoft_corporation\powershell_ise.exe_StrongName_lw2v2vm3wmtzzpebq33gybmeoxukb04w | |
#> | |
$ISEPath = "$env:localappdata\microsoft_corporation\powershell_ise*\3.0.0.0" |
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
#requires -version 4.0 | |
Function Test-UporDown { | |
<# | |
.Synopsis | |
Test if a web site is down or if it is just you. | |
.Description | |
The function uses the web site DownForEveryoneOrJustme.com to test is a web site or domain is up or down, or if the problem is just you. The command will write a custom object to the pipeline. See examples. |
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
#requires -version 5.0 | |
<# | |
Weekly.tests.ps1 | |
a Pester test for the week | |
Usage: Invoke-Pester .\Weekly.tests.ps1 | |
#> |
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
Param( | |
[string[]]$Computername = "chi-test02" | |
) | |
[DscLocalConfigurationManager()] | |
Configuration ResetLCM { | |
Param([string[]]$Computername) |