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
function Test-AliasBinding | |
{ | |
[CmdletBinding()] | |
param( | |
[Alias("DNSHostName")] | |
[Parameter( | |
Mandatory=$True, | |
#ValueFromPipeline = $True, | |
ValueFromPipelineByPropertyName=$True |
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
$worldTab = @{} | |
$esxcli = Get-EsxCli | |
$esxcli.vm.process.list() | %{ | |
$worldTab.Add($_.WorldID,$_.DisplayName) | |
} |
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 |
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 any command that has $ParameterName as an available parameter: | |
Get-Command | Where-Object { $_.parametersets.parameters.Name -eq "$ParameterName" } |
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
$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
param | |
( | |
[Parameter(ValueFromPipeline="true")] | |
[String]$PosixVars | |
) | |
Process | |
{ | |
$PosixVars ` | |
| ForEach-Object { |
OlderNewer