![windows server 2016 上的 powershell 5.1 不起作用](https://linux22.com/image/713856/windows%20server%202016%20%E4%B8%8A%E7%9A%84%20powershell%205.1%20%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在按照这个 Microsoft官方 Azure 实验室在标题下Deploying Azure SQL Database by using the Azure PowerShell
。实验室中的 VM 机器是Windows Server 2016
。当我运行步骤 6 中的以下命令时,它会提示我输入如下所示的内容。不确定我需要在那里输入什么。笔记:我已经从这里:
上述链接教程的第 6 步:
PS C:\Users\Student> $pass = ConvertTo-SecureString 'Pa55w.rd1234' –AsPlainText –Force
$cred = New-Object
System.Management.Automation.PSCredential('Student',$pass)
server = New-AzureRmSqlServer –ServerName 'raztestsqlserver' -
SqlAdministratorCredentials $cred –Location 'centralus' -
ServerVersion '12.0' –ResourceGroupName 'SQLDBRG'
PS 提示如下:
cmdlet New-Object at command pipeline position 1
Supply values for the following parameters:
TypeName:
答案1
这不是 Azure Power Shell 问题。
$cred = New-Object System.Management.Automation.PSCredential('Student',$pass)
复制脚本时出现换行符。
该脚本应如下所示:
$pass = ConvertTo-SecureString 'Pa55w.rd1234' –AsPlainText –Force
$cred = New-Object System.Management.Automation.PSCredential('Student',$pass)
$server = New-AzureRmSqlServer –ServerName 'raztestsqlserver' -SqlAdministratorCredentials $cred –Location 'centralus' -ServerVersion '12.0' –ResourceGroupName 'SQLDBRG'