This list has been moved here: https://github.com/corbob/Reference/blob/master/PodCasts.md
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
# Works | |
Param( | |
[Parameter(mandatory)] | |
$a, | |
[ValidateSet(1,2,3,4,5,6,7,8,9)] | |
$b | |
) | |
# doesn't work... | |
param ( | |
[string]$Str, |
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
#region prompt | |
$forePromptColor = 0 | |
[System.Collections.Generic.List[ScriptBlock]]$PromptRight = @( | |
# right aligned | |
{ "$FG;${er}m{0}" -f $LeftArrow } | |
{ "$FG;${forePromptColor}m$BG;${er}m{0}" -f $(if (@(get-history).Count -gt 0) {(get-history)[-1] | % { "{0:c}" -f (new-timespan $_.StartExecutionTime $_.EndExecutionTime)}}else {'00:00:00.0000000'}) } | |
{ "$FG;7m$BG;${er}m{0}" -f $LeftArrow } | |
{ "$FG;0m$BG;7m{0}" -f $(get-date -format "hh:mm:ss tt") } |
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
Sub GenerateFullHotkeyList | |
on error resume next | |
Set objShell = CreateObject("Shell.Application") | |
' GenerateFullHotkeyInFolder(objShell.NameSpace(11)) ' | |
GenerateFullHotkeyInFolder(objShell.NameSpace(17)) 'My Comp | |
headrow = "<THEAD class=instruct>" & vbcrlf & "<TR><TD WIDTH=" & chr(34) & "20%" & chr(34) & "><b>Key</b></TD><TD WIDTH=" & chr(34) & "35%" & chr(34) & "><b>Shortcut Location</b><br>Click to find in Explorer</TD><TD WIDTH=" & chr(34) & "35%" & chr(34) & "><b>Target</b><br>Click to find in Explorer</TD></TR></THEAD>" | |
If DiagVar<>"" then | |
FullHotKeyList.InnerHTML = "<table id=tfullhotkeylist>" & headrow & DiagVar & "</table>" | |
Else | |
FullHotKeyList.InnerHTML = "<p style='color:red'><b>No hotkeys found</b></p>" |
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
I would like to turn this: | |
[ordered]@{ | |
Envelope = [ordered]@{ | |
Header = '' | |
Body = [ordered]@{ | |
listPhone = [ordered]@{ | |
searchCriteria = [ordered]@{ | |
callingSearchSpaceName = '%' | |
} | |
returnedTags = [ordered]@{ |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
opacity: 0.8, | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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 ci { | |
$lastCommand = Get-History -Count 1 | |
$newCommand = $lastCommand.CommandLine.Replace('clist','cinst').Replace('choco list','choco install') | |
Invoke-Expression $newCommand | |
} |
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 test { | |
[CmdletBinding(SupportsShouldProcess)] | |
param() | |
$a = New-TemporaryFile | |
remove-item $a | |
} |
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 Add-MyPhone { | |
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] | |
$PhoneName, | |
[Parameter(Mandatory = $true)] | |
[ValidateSet('Cisco 6941', 'Cisco 7841', 'Cisco 7942')] | |
[string] | |
$Product, |
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 Check-Help { | |
[CmdletBinding()] | |
param ( | |
$Command | |
) | |
$CommandExists = $false | |
Try { | |
Get-Command $Command -ErrorAction Stop | |
$CommandExists = $true | |
} catch [System.Management.Automation.CommandNotFoundException] { |