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 parseNetstat { | |
param([object[]]$Lines) | |
if ($IsWindows) { | |
$skip = 4 | |
} else { | |
$skip = 3 | |
} | |
$Lines | Select-Object -Skip $skip | ForEach-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 New-DevOpsWorkItem { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string]$title, | |
[Parameter(Mandatory=$true)] | |
[string]$description, | |
[int]$parentId, | |
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
class Cards { | |
[System.Collections.Generic.List[string]]$cards | |
[string]$name | |
Cards([string]$_name) { | |
$this.name = $_name | |
$this.cards = [System.Collections.Generic.List[string]]::new() | |
} | |
NewDeck() { |
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]$startURL, | |
[switch]$showall | |
) | |
$ErrorActionPreference = 'Stop' | |
$Error.Clear() | |
$lastError = $null | |
function getUrl { |
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-logonevents { | |
param( | |
[string]$computer=$env:computername, | |
[int]$days = 30 | |
) | |
$millisecperday = 24*60*60*1000 | |
$logonType = @{ | |
2='Interactive'; | |
3='Network'; | |
4='Batch'; |
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 update-sysinternals { | |
param([switch]$exclusions=$false) | |
$identity = [Security.Principal.WindowsIdentity]::GetCurrent() | |
$principal = [Security.Principal.WindowsPrincipal] $identity | |
if($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
$web = get-service webclient | |
if ($web.status -ne "Running") { "Starting webclient..."; start-service webclient } | |
$web = get-service webclient | |
while ($web.status -ne "Running") { sleep -sec 1 } | |
if ($exclusions) { |