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 Group-ConsecutiveNumbers { | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline, Mandatory, Position=0)] | |
$number | |
) | |
begin { $numbers = @() } | |
process { $numbers += $number } | |
end { |
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
docker run --rm -it --volume //./pipe/docker_engine://./pipe/docker_engine --mount type=bind,source="C:\Program Files\Docker",destination="C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps" --entrypoint=powershell mcr.microsoft.com/windows/servercore:ltsc2019 docker --version |
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
ssh-keygen && cat $env:userprofile/.ssh/id_rsa.pub | ssh user@linuxserver 'cat >> .ssh/authorized_keys' |
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
<# | |
Adds the conditional ternary operator. | |
Use e.g: | |
`$Color = $Settings.HasColor |?: $Settings.Color "blue"` | |
#> | |
function ConditionalTernary { | |
param ( | |
[Parameter(ValueFromPipeline=$true)]$Value, |
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
<# | |
Adds the null coalescing operator. | |
Use e.g: | |
`$Color = $Settings.Color |?? "blue"` | |
#> | |
function NullCoalesc { | |
param ( | |
[Parameter(ValueFromPipeline=$true)]$Value, |