1

I'm following exercise 1 of this Microsoft official Azure lab under the heading Deploying Azure SQL Database by using the Azure PowerShell. The VM machine in the lab is Windows Server 2016. When I run the the following command of step 6 it prompts me for an input shown below. Not sure what input I need to put there. Note: I've installed Azure PowerShell 5.1 from here:

Step 6 of above linked tutorial:

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 prompt the following:

cmdlet New-Object at command pipeline position 1
Supply values for the following parameters:
TypeName: 

1 Answer 1

2

This is not a Azure Power Shell issue.

$cred = New-Object System.Management.Automation.PSCredential('Student',$pass)

There is a line break when you copy script.

enter image description here

The script should like below:

$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'
10
  • @nam I update my answer. You need move link break in your script. Nov 22, 2017 at 3:17
  • @nam I test in my lab, the script works for me. Nov 22, 2017 at 3:18
  • @ShengbaoShuiMSFT You seem to have identified the mistake I'm making. I ran the first line (shown in your screeshot) and it prompted me for an input for TypeName. Question: what do I type in the input there? I typed user name Student but it gave me the error cannot find the type Student
    – nam
    Nov 22, 2017 at 3:25
  • 1
    @nam I suggest you could copy script to NotePad++ not directly to Power Shell. You will find the line break. Nov 22, 2017 at 4:27
  • 1
    @nam Using NotePad++, you will see the difference clearly. imgur.com/a/cdfs7 Nov 22, 2017 at 4:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .