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
#Name: PS-ResetWUMU.ps1 | |
#Author: github.com/livkx | |
#Decription: Reset WUMU config, cache, certs. Then, run a scan and try check in with WSUS. | |
#Version: 1.0 | |
#Declare the functions we're going to use in the main function. | |
Function ServiceControlAndWait{ #Function stops the Windows Update related services. | |
param([Parameter(Position = 0)] [String[]] $Services, [String] $MaxWait, [String] $Action) | |
ForEach($Service in $Services){ |
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
class Ping | |
{ | |
# Property | |
[array] $Results | |
[array] $Online | |
[array] $Offline | |
$ExecutionTime | |
$TotalComputers | |
$OnlineCount | |
$OnlinePercent |
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
[ONLINE] | |
;DataCenterHint => | |
; default 'ping based' | |
; eus 'us east' | |
; cus 'us central' | |
; scus 'us south central' | |
; wus 'us west' | |
; sbr 'brazil south' | |
; neu 'europe north' |
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-ServiceUsers | |
{ | |
<# | |
.Synopsis | |
Get a list of unique usernames being used to run services on a computer. | |
.DESCRIPTION | |
Get a list of unique user's being used to run services on one or more computers. | |
.PARAMETER ComputerName |
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
public static string NumberToCurrencyText(decimal number, MidpointRounding midpointRounding) | |
{ | |
// Round the value just in case the decimal value is longer than two digits | |
number = decimal.Round(number, 2, midpointRounding); | |
string wordNumber = string.Empty; | |
// Divide the number into the whole and fractional part strings | |
string[] arrNumber = number.ToString().Split('.'); | |
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 | |
Backup-CiscoConfig.ps1 SSHs to a Cisco device and backs up the running configuration to a TFTP server.. Utilizes the Posh-SSH module. | |
.DESCRIPTION | |
This script is not possible without darkoperator's Posh-SSH module. Thanks! | |
To do: Parameterize the device list. 10/05/16 | |
Grab the output of long commands by setting the terminal length to 0 to disable pagination. "term len 0" | |
Log commands entered on the Cisco device to ensure they're running: |
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 | |
An MTR clone for PowerShell. | |
Written by Tyler Applebaum. | |
Version 2.0 | |
.LINK | |
https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2 | |
http://www.team-cymru.org/IP-ASN-mapping.html#dns |
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
$number = "12025550108" | |
$message = "Howdy, this is a message from PowerShell." | |
$clientId = "FREE_TRIAL_ACCOUNT" # No need to change | |
$clientSecret = "PUBLIC_SECRET" # No need to change | |
$jsonObj = @{'number'=$number; | |
'message'=$message;} | |
Try { |