This file contains hidden or 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 | |
Wraps the Invoke-Command to seamlessy execute script blocks remote or local | |
.DESCRIPTION | |
Invoke-Command does not provide a transparent method to execute script blocks locally or remotely without conditions. This limited wrapper commandlet does this. | |
Every blocked is wrapped with logging statements | |
.PARAMETER ScriptBlock | |
The script block | |
.PARAMETER BlockName | |
Name of the block. This is for logging purposes. |
This file contains hidden or 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 to scan for session on a remote computer and then rwinsta to disconnect it | |
.NOTES | |
.LINK |
This file contains hidden or 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
Set-PSReadlineKeyHandler -Chord "Ctrl+1" -BriefDescription 'Toggle $DebugPreference' -Description 'Toggle $DebugPreference between Continue and SilentlyContiinue' -ScriptBlock { | |
if($DebugPreference -eq 'Continue') | |
{ | |
Write-Debug "Setting DebugPreference=SilentlyContinue" | |
Set-Variable -Name DebugPreference -Value "SilentlyContinue" -Scope Global -Force | |
return | |
} | |
if($DebugPreference -eq 'SilentlyContinue') | |
{ | |
Set-Variable -Name DebugPreference -Value "Continue" -Scope Global -Force |
This file contains hidden or 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 | |
Reset the window title of the console | |
.DESCRIPTION | |
Reset the window title of the console | |
.EXAMPLE | |
Reset-PrefixedTitle | |
#> | |
function Reset-PrefixedTitle | |
{ |
This file contains hidden or 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 | |
Formats the output of Compare-Object for even results | |
.DESCRIPTION | |
When the compared set has even entries use this commandlet to promote the output Compare-Object to Name,Original,Changed using the SideIndicator | |
.PARAMETER Compare | |
The output of Compare-Object | |
.PARAMETER PathAsName | |
The path to use to create the Name column in the output | |
.EXAMPLE |
This file contains hidden or 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(Mandatory=$true)] | |
[string]$NewWindowsServerVersionComputer, | |
[Parameter(Mandatory=$true)] | |
[string]$OldWindowsServerVersionComputer | |
) | |
# Process new windows server version | |
$featuresOnNew=Get-WindowsFeature -ComputerName $NewWindowsServerVersionComputer | |
$availableOnNew=$featuresOnNew|Where-Object -Property "InstallState" -EQ "Available" | |
$installedNew=$featuresOnNew|Where-Object -Property "InstallState" -EQ "Installed" |
This file contains hidden or 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
#Requires -RunAsAdministrator | |
<# | |
.Synopsis | |
Creates a new Hyper-V instance from a named template. | |
.DESCRIPTION | |
Imports an existing Hyper-V export into a new instance, set-up the local client host/ip resoltution and generate bootstrapping powershell script. | |
.PARAMETER OSVersion | |
The code name for operating system | |
.PARAMETER VMName |
This file contains hidden or 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 | |
Compares system modules with available ones on powershell gallery | |
.DESCRIPTION | |
Compares system modules with available ones on powershell gallery | |
.EXAMPLE | |
Compare-SystemModuleWithGallery | |
.Link | |
http://mikefrobbins.com/2016/06/09/update-manually-installed-powershell-modules-from-the-powershell-gallery/ | |
#> |
This file contains hidden or 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 | |
Reports modules | |
.DESCRIPTION | |
Reports modules | |
.EXAMPLE | |
Show-ModuleVersion | |
.EXAMPLE | |
Show-ModuleVersion -ListAvailable | |
.EXAMPLE |
This file contains hidden or 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(Mandatory=$false)] | |
[ValidateSet("ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-west-1","eu-west-2","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2")] | |
[string]$Region="eu-west-1", | |
[Parameter(Mandatory=$false)] | |
[string]$OutputPath="$env:USERPROFILE\Documents\AWSCloudFormation-samples-json-yaml" | |
) | |
Set-StrictMode -Version latest | |
$rubyPath=& "C:\Windows\System32\where.exe" ruby 2>&1 |
OlderNewer