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: 
nam
  • 217
  • 1
  • 11

1 Answers1

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'
Shui shengbao
  • 3,503
  • 1
  • 10
  • 20
  • @nam I update my answer. You need move link break in your script. – Shui shengbao Nov 22 '17 at 03:17
  • @nam I test in my lab, the script works for me. – Shui shengbao Nov 22 '17 at 03: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 '17 at 03:25
  • @ShengbaoShuiMSFT Your suggestion worked. Thank you for pointing out my mistake. I'm in a learning mode for Powershell. – nam Nov 22 '17 at 03:34
  • @nam The `TypeName` is `System.Management.Automation.PSCredential('Student',$pass)`. – Shui shengbao Nov 22 '17 at 04:26
  • 1
    @nam I suggest you could copy script to NotePad++ not directly to Power Shell. You will find the line break. – Shui shengbao Nov 22 '17 at 04:27
  • 1
    @nam Using NotePad++, you will see the difference clearly. https://imgur.com/a/cdfs7 – Shui shengbao Nov 22 '17 at 04:31
  • Would you have an answer to [this](https://serverfault.com/q/884729/425441) post. – nam Nov 22 '17 at 18:07
  • OK, I will check. Sorry, I am not at office, I will answet you after a hour. – Shui shengbao Nov 22 '17 at 23:29
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/69147/discussion-between-shengbao-shui-msft-and-nam). – Shui shengbao Nov 23 '17 at 01:27