-
-
Save mano8/1260da0c4c3a7be2bb2238541c83018c to your computer and use it in GitHub Desktop.
Revisions
-
bdanse created this gist
Nov 4, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #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 Get-AutomationPSCredential -Name 'MyCredentialAssetName'