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
def foo( | |
) { | |
sh ''' | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, | |
sed do eiusmod tempor incididunt ut labore et dolore | |
magna aliqua. Adipiscing diam donec adipiscing tristique | |
risus. Aenean vel elit scelerisque mauris pellentesque | |
pulvinar pellentesque. Ullamcorper dignissim cras | |
tincidunt lobortis feugiat vivamus at. Nunc sed velit | |
dignissim sodales ut eu sem integer. Amet est placerat |
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
// To view the default settings, hold "alt" while clicking on the "Settings" button. // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{dba43f41-44c5-4686-8615-6d4bf260f608}", | |
"profiles": | |
[ | |
{ |
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
param | |
( | |
[Parameter(ValueFromPipeline="true")] | |
[String]$PosixVars | |
) | |
Process | |
{ | |
$PosixVars ` | |
| ForEach-Object { |
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
$certParams = | |
@{ | |
Type = 'Custom' | |
KeyUsage = 'DigitalSignature' | |
FriendlyName = 'WindowsTerminal' | |
CertStoreLocation = 'Cert:\LocalMachine\My' | |
Subject = ( | |
'CN=Microsoft Corporation', | |
'O=Microsoft Corporation', | |
'L=Redmond', |
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 Reduce-Object | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory = $true)] | |
$InitialValue, | |
[Parameter(ValueFromPipeline = $true)] | |
$InputObject, |
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
# Get any command that has $ParameterName as an available parameter: | |
Get-Command | Where-Object { $_.parametersets.parameters.Name -eq "$ParameterName" } |
These are some commands that I've found useful over my time working with Git.
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
# From http://stackoverflow.com/questions/191364/quick-unix-command-to-display-specific-lines-in-the-middle-of-a-file | |
# Print lines 20 to 40 of a text file: | |
sed -n '20,40p;41q' file_name | |
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
Get-EC2Instance | Select-Object -ExpandProperty instances | Select-Object InstanceId, @{Name='Name'; Expression={$_.Tags | Where-Object { $_.Key -like 'Name'} | Select-Object -ExpandProperty Value }}, InstanceType, @{Name='AMI'; Expression={Get-EC2Image -ImageId $_.ImageID | Select-Object -ExpandProperty name}}, @{Name='StorageConfig'; Expression={"Storage"}}, @{Name='SubnetName'; Expression={Get-Ec2Subnet -SubnetId $_.SubnetId | Select-Object -ExpandProperty Tags | Where-Object { $_.Key -like 'Name' } | Select-Object -ExpandProperty Value }} | Sort-Object -Property Name | Out-GridView |
NewerOlder