Skip to content

Instantly share code, notes, and snippets.


Chris Hunt cdhunt

View GitHub Profile
View Start-PSNodeExample.ps1
PS C:\> Start-PSNode -Server http://localhost:9092/ -AuthenticationType IntegratedWindowsAuthentication -Command {
Get-Process | Select-Object Handle, WorkingSet, Id, Name, UserProcessorTime | ConvertTo-Json
View Get-WebExample.ps1
PS C:\> Get-Web "http://localhost:9092" -AsJson
View Get-WebExample2.ps1
PS C:\> Get-Web -Url -AsMicrodata -ItemType | Export-PSData .\
cdhunt / Posh2013_Event5
Created May 30, 2013
Second attempt at Event 5 based on what I learned from feedback and judging other scripts.
View Posh2013_Event5
function Select-UniqueClientIP {
cdhunt / Get-CredentialFromWindowsCredentialManager.ps1
Last active Jul 11, 2019 — forked from toburger/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
View Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC
cdhunt / APIExample
Created Jul 29, 2013
Example of marrying REST API and Windows COM API through Powershell.
View APIExample
function Out-Speech($text) {
$speechy = New-Object –ComObject SAPI.SPVoice;
$voices = $speechy.GetVoices();
foreach ($voice in $voices) {
$speechy.Voice = $voice;
cdhunt / Get-NetworkHostList
Created Jan 13, 2014
Part of 2014 Scripting Games Practice Event
View Get-NetworkHostList
Return an array of IP Addresses
Return an array of System.Net.IPAddress objects from a string in the form
Return an array of usable IP addresses given a subnet.
PS C:\> $IPs = Get-NetworkHostList
PS C:\> $IPs[0].IPAddressToString
View PingSweep
Import-Module PModule.psm1
$Credential = Get-Credential
$ips = Get-NetworkHostList
$list = $ips[(70..75)]
$c = 0
Foreach ($computer in $list)
[bool]$alive = $false
Write-Progress -Activity "Finding available hosts" -CurrentOperation "Testing" -Status $computer -PercentComplete (($c++/$list.count)*100)
cdhunt / powerlambda
Last active Aug 29, 2015
Trying to create a variable containing a lambda expression
View powerlambda
# Trying to call ListByNameFiltered from
# (input parameters) => expression
# (id) => { return id == 1234; }
if ( [string]::IsNullOrEmpty([psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get["Expression"]) )
You can’t perform that action at this time.