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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string] $PythonVersion | |
) | |
$ErrorActionPreference = "Stop" | |
$ProgressPreference = "SilentlyContinue" | |
Set-StrictMode -Version Latest |
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' | |
# setup temporary profile path for the alternative user | |
$altIdProfilePath = Join-Path ([io.path]::GetTempPath()) '.azure-altId' | |
try { | |
# check whether already logged-in | |
$currentToken = $(az account get-access-token) | ConvertFrom-Json | |
if ([datetime]$currentToken.expiresOn -le [datetime]::Now) { | |
throw | |
} |
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-MockVariableSet([hashtable]$props) | |
{ | |
$varset = new-object 'OctoPosh.Model.OutputOctopusVariableSet' | |
$varset.ID = $props.Id | |
$varset.LibraryVariableSetName = $props.Name | |
$varset.Variables = new-object 'System.Collections.Generic.List[OctoPosh.Model.FriendlyVariable]' | |
$varset.Resource = new-object 'Octopus.Client.Model.VariableSetResource' | |
$varset.Resource.Id = $props.Id | |
foreach ($v in $props.Variables) |
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
gci *.mof | % { gc -raw $_ | % { $patched = $_ -replace "\[version" ,"[ClassVersion"; $patched = $patched -replace "MSFT_BaseResourceConfiguration" ,"OMI_BaseResource" }; sc $_ $patched } |
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(Mandatory) ] | |
[String[]] $ComputerName, | |
[ValidateRange( 1,3 )] | |
[uint32] $flag = 1 | |
) | |
Invoke-CimMethod -ComputerName $ComputerName -Namespace root/microsoft/windows/desiredstateconfiguration ` |
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(Mandatory) ] | |
[String[]] $ComputerName, | |
[ValidateRange( 1,3 )] | |
[uint32] $flag = 3 | |
) | |
Invoke-CimMethod -ComputerName $ComputerName -Namespace root/microsoft/windows/desiredstateconfiguration ` |
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 | |
( | |
$resources = @(), | |
$pullServerRoot = "C:\ProgramData\PSDSCPullServer" | |
) | |
function New-Hash | |
{ | |
param | |
( |
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
Configuration SetPullMode | |
{ | |
Node Server01 | |
{ | |
# Set the DSC engine (LCM) to Pull mode | |
LocalConfigurationManager | |
{ | |
ConfigurationID = "e528dee8-6f0b-4885-98a1-1ee4d8e86d82" | |
ConfigurationMode = "ApplyOnly" | |
RefreshMode = "Pull" |
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
Configuration SetPullMode | |
{ | |
Node Server01 | |
{ | |
# Set the DSC engine (LCM) to Pull mode | |
DesiredStateConfigurationSettings LCM | |
{ | |
ConfigurationID = "e528dee8-6f0b-4885-98a1-1ee4d8e86d82" | |
ConfigurationMode = "Pull" | |
DownloadManagerName = "WebDownloadManager" |
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
Configuration PullDemo | |
{ | |
Node Server01 | |
{ | |
Computer RenameServer01 | |
{ | |
Name = "NewHostName" | |
} | |
} | |
} |
NewerOlder