New-AzAutomationCredential
	
	
	语法
	
		Default (默认值)
	
	
		New-AzAutomationCredential
    [-Name] <String>
    [-Description <String>]
    [-Value] <PSCredential>
    [-ResourceGroupName] <String>
    [-AutomationAccountName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
	 
	说明
	
		
              New-AzAutomationCredential cmdlet 在 Azure 自动化中创建凭据作为 PSCredential 对象。
	 
	示例
	示例 1:创建凭据
	
		$User = "Contoso\PFuller"
$Password = ConvertTo-SecureString -String "****" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $Password
New-AzAutomationCredential -AutomationAccountName "Contoso17" -Name "ContosoCredential" -Value $Credential -ResourceGroupName "ResourceGroup01"
第一个命令将用户名分配给$User变量。
第二个命令使用 ConvertTo-SecureString cmdlet 将纯文本密码转换为安全字符串。
该命令将该对象存储在$Password变量中。
第三个命令基于$User和$Password创建凭据,然后将其存储在$Credential变量中。
最后一个命令创建一个名为 ContosoCredential 的自动化凭据,该凭据使用 $Credential。
	 
	参数
		-AutomationAccountName
		指定此 cmdlet 在其中存储凭据的自动化帐户的名称。
		参数属性
		
				| 类型: | String | 
				| 默认值: | None | 
				| 支持通配符: | False | 
				| 不显示: | False | 
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | 1 | 
						| 必需: | True | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | True | 
						| 来自剩余参数的值: | False | 
				
			 
		-DefaultProfile
		用于与 azure 通信的凭据、帐户、租户和订阅
		参数属性
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | Named | 
						| 必需: | False | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | False | 
						| 来自剩余参数的值: | False | 
				
			 
		-Description
		指定凭据的说明。
		参数属性
		
				| 类型: | String | 
				| 默认值: | None | 
				| 支持通配符: | False | 
				| 不显示: | False | 
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | Named | 
						| 必需: | False | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | True | 
						| 来自剩余参数的值: | False | 
				
			 
		-Name
		指定凭据的名称。
		参数属性
		
				| 类型: | String | 
				| 默认值: | None | 
				| 支持通配符: | False | 
				| 不显示: | False | 
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | 2 | 
						| 必需: | True | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | True | 
						| 来自剩余参数的值: | False | 
				
			 
		-ResourceGroupName
		指定此 cmdlet 为其创建凭据的资源组的说明。
		参数属性
		
				| 类型: | String | 
				| 默认值: | None | 
				| 支持通配符: | False | 
				| 不显示: | False | 
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | 0 | 
						| 必需: | True | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | True | 
						| 来自剩余参数的值: | False | 
				
			 
		-Value
		将凭据指定为 PSCredential 对象。
		参数属性
		
		参数集
			
				
					(All) 
					
						
					
				
				
						| Position: | 3 | 
						| 必需: | True | 
						| 来自管道的值: | False | 
						| 来自管道的值(按属性名称): | True | 
						| 来自剩余参数的值: | False | 
				
			 
		CommonParameters
		
			此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
		 
	
			
			
				
			
			
			
				
			
	输出