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
<# | |
.SYNOPSIS | |
Converts [xml] objects to memory object | |
.DESCRIPTION | |
Converts [xml] objects to memory object with some control over attribute values and property names | |
.PARAMETER AttributesGroupProperty | |
Name of property for values read from node attributes | |
.PARAMETER LowerCasePropertyNames | |
Convert all property names lower case | |
.EXAMPLE |
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
# Install ruby-build | |
sudo apt install ruby-build -y | |
# Install Ruby 2.4.0 | |
rbenv install 2.4.0 | |
# Add rbenv initialization to profile | |
echo 'export PATH="$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile |
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
<# Goal | |
In between null and arrays need to be transparently resolved | |
Filter an in memory typed structure generated from the followign xml | |
example expression dataElementsMaster.dataElementsIndiv.serviceRequest.ssr.type -eq CTCE | |
instead of | |
$pnrRetrieveResponse.dataElementsMaster.dataElementsIndiv | Where-Object { | |
($_.serviceRequest -ne $null) -and | |
($_.serviceRequest.ssr -ne $null) -and | |
($_.serviceRequest.ssr.type -eq "CTCE") | |
} |
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
<# | |
.Synopsis | |
Disconnects your user from remote computers | |
.DESCRIPTION | |
This scripts uses the quser and qwinsta to scan for session on a remote computer and then rwinsta to disconnect it | |
.NOTES | |
.LINK |
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 New-RandomPassword | |
{ | |
param( | |
[Parameter(Mandatory=$false)] | |
[int]$Length=8 | |
) | |
begin { | |
} |
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-PesterInvocation { | |
$commandStack=Get-PSCallStack | Select-Object -ExpandProperty Command | |
#region Render | |
<# | |
for($i=$commandStack.Count-1;$i -ge 0;$i--) | |
{ | |
$prefix="+".PadRight($commandStack.Count-1-$i,'-') | |
Write-Host ($prefix+$commandStack[$i]) | |
} |
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
<# | |
.Synopsis | |
Starts a remote desktop connection | |
.DESCRIPTION | |
Starts a remote desktop connection | |
.EXAMPLE | |
Start-MyRemoteDesktopConnection | |
#> | |
function Start-MyAsSystem | |
{ |
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-ISHCMWebSession { | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string]$DeploymentName, | |
[Parameter(Mandatory=$false)] | |
[PSCredential]$Credential=$null | |
) | |
$deployment=Get-ISHDeployment -Name $DeploymentName | |
$deploymentParameters=Get-ISHDeploymentParameters -ISHDeployment $DeploymentName |
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 GetRandomString([int]$length){ | |
-join ((65..90) + (97..122) | Get-Random -Count $length | % {[char]$_}) | |
} |
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 container prune # Remove all stopped containers | |
docker volume prune # Remove all unused volumes | |
docker image prune # Remove unused images | |
docker system prune # All of the above, in this order: containers, volumes, images |
NewerOlder