Skip to content

Instantly share code, notes, and snippets.

View brianbunke's full-sized avatar

Brian Bunke brianbunke

View GitHub Profile
@brianbunke
brianbunke / PSGames-201601.ps1
Last active January 4, 2016 06:45
PSGames-201601
function Get-Uptime {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
[string[]]$ComputerName = $env:COMPUTERNAME
)
BEGIN {
# Define $Results array to append each computer into; get the current date once
function Invoke-PowerCSV {
[CmdletBinding()]
param (
# Position 1 is implied here, and doesn't need to be specified
[Parameter(Mandatory = $true)]
[string[]]$ComputerName,
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
$InputFile,
@brianbunke
brianbunke / PSGames-Dec2015.ps1
Last active December 8, 2015 01:53
2015-12 PowerShell Scripting Games Puzzle
$List = @'
1 Partridge in a pear tree
2 Turtle Doves
3 French Hens
4 Calling Birds
5 Golden Rings
6 Geese a laying
7 Swans a swimming
8 Maids a milking
9 Ladies dancing
@brianbunke
brianbunke / NewSplit.ps1
Last active November 12, 2015 00:28
2015-11 PowerShell.org Scripting Games Puzzle
# Ideally this is [string[]]
param([string]$VMNameStr)
# Copying from old: Split up names by commas, trim the ends, output to screen
$VMNameStr -split "," | %{$_.trim()}