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
<# | |
IsReady is the option of an internal determination of whether an operation needs to execute or is safe to execute. | |
A switch of -WhatIf will override anything else. | |
A switch of -Force can override an unsafe operation. It is not prompted. | |
A prompt for confirmation only occurs if needed, and this will show on interactive sessions, while being denied on | |
noninteractive sessions. | |
#> | |
function Test-ShouldProcess { | |
[CmdletBinding(SupportsShouldProcess)] |
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
(ConvertFrom-Json (Invoke-WebRequest "https://api.github.com/users/historicalsource/repos?page=1&per_page=100").Content).clone_url | ForEach-Object { &git clone $_ } |
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
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version "Latest" | |
function Create-Login { | |
$loginSetup = " | |
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = 'LAB\CHWK01$') DROP LOGIN [LAB\CHWK01$]; | |
CREATE LOGIN [LAB\CHWK01$] FROM WINDOWS; | |
GRANT CONTROL SERVER TO [LAB\CHWK01$]; | |
" | |
"SEC1N1", "SEC1N2", "SEC1N3", "DAC1N1", "DAC1N2" | New-DbConnection | New-DbCommand $loginSetup | Get-DbData |
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
# Faster to get them all at once than look up a few dozen individually | |
$galleryModules = Find-Module -Verbose:$false | |
# If you only want to update modules sourced from the PowerShell Gallery, you can add a filter by: | |
# Where-Object { $_.RepositorySourceLocation -eq "https://www.powershellgallery.com/api/v2/" } | |
Get-Module -ListAvailable -Verbose:$false | Group-Object Name | ForEach-Object { | |
if (($_.Group | ForEach-Object Version | Select-Object -Unique | Measure-Object).Count -gt 1) { | |
Write-Verbose "$($_.Name) has multiple versions installed, I will only check the highest version" | |
} | |
$module = $_.Group | Sort-Object Version -Descending | Select-Object -First 1 |
NewerOlder