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 boxstarter | |
# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force | |
# Install-BoxstarterPackage -PackageName gisturi | |
Update-ExecutionPolicy Unrestricted | |
Set-ExplorerOptions -showFileExtensions | |
Disable-InternetExplorerESC | |
Install-WindowsUpdate -AcceptEula | |
Install-Module -Name Az -AllowClobber -Scope AllUsers |
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
# Standard method of retrieving credentials | |
Get-AutomationPSCredential -Name Name1 | |
# Alternative method with keyvault specified | |
Get-KeyvaultPSCredential -name Name1 -VaultName mykeyvault | |
# Alternative method without keyvault specified | |
# Make sure there is an Automation variable created named PSCredentialKeyVault | |
Get-KeyvaultPSCredential -name Name1 |
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
#Single keyvault PSCredential secret | |
Set-KeyvaultPSCredential -Name 'Name1' -UserName 'domain\user2' -VaultName mykeyvault | |
#Create multiple keyvault PSCredential secrets based on a hashtable | |
$hash = @( | |
@{ | |
Name = 'Name1' | |
UserName = 'domain\User1' | |
}, | |
@{ |
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
#Create a secure string for the password | |
$SecureStringPassword = ConvertTo-SecureString "SuperSecretPassw0rd" -AsPlainText -Force | |
#Create a PSCredential object | |
$PSCredential = New-Object System.Management.Automation.PSCredential('domain\myusername', $SecureStringPassword) | |
#Write PSCredential object to an Azure Automation account | |
New-AzureRmAutomationCredential -Name 'MyCredentialAssetName' -Value $PSCredential | |
#Retrieve PSCredential object from within a runbook of DSC compilation job |