View ps-colours.ps1
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
# output all the colour combinations for text/background | |
# http://stackoverflow.com/a/41954792/10245 | |
$colors = [enum]::GetValues([System.ConsoleColor]) | | |
Select-Object @{N='ColorObject';E={$_}}, | |
@{N='ColorName'; E={ | |
If ($_.ToString().substring(0,3) -eq 'Dar' ){ | |
$_.ToString().Substring(4) + 'DARK' | |
} else { | |
$_.ToString() | |
} |
View Get-Between.ps1
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
<# | |
Skip the outermost records based on a column of a list | |
OR | |
Do the opposit and select the outermost records based on a column of a list | |
Use Tabcompletion to select the column | |
Get-Between -list $a.people -NotePropertyName <tabcomplete> [name or age] | |
Age will give: |
View Get-ISO8601Week
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-ISOWeek { | |
Param( | |
[Parameter( | |
# Mandatory, | |
ValueFromPipeline, | |
ValueFromPipelineByPropertyName, | |
HelpMessage = 'Valid Date' | |
)] | |
[Alias('DT', 'DateTime')] | |
[datetime[]]$Dates = (Get-Date), |
View Get-ISOWeek.psm1
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
<# | |
Place this file in the Modules Folder under .\Get-ISOWeek | |
The subfolder should have the same name as this File | |
#> | |
<# | |
Write-Host " Culture: " -NoNewline | |
(20..31).ForEach( { Get-ISO8601Week("2012-12-$($_)") -Verbose }) + ((1..7).ForEach( { Get-ISO8601Week("2013-1-$($_)") -Verbose })) -join ', ' | |
#> |