microsoft / Analysis-Services

Git repo for Analysis Services samples and community projects
MIT License
602 stars 415 forks source link

Invoke-AsCmd does not work with quote in passwords #54

Closed fmms closed 3 years ago

fmms commented 4 years ago

Hi,

I think i found a bug in Invoke-AsCmd.

I am using the following code snippet:

$asAdminPassword = @'
This"is"aPassword%$%
'@ -replace '"', '""'
$SECURE_PASSWORD = ConvertTo-SecureString $('"{0}"' -f $asAdminPassword) -AsPlainText -Force
$CREDENTIAL = New-Object System.Management.Automation.PSCredential ("aaaa@bbb.com", $SECURE_PASSWORD)
Invoke-ASCmd -InputFile "adjustconnection.tmsl" -Server "asazure://westeurope.asazure.windows.net/ccc:rw" -Credential $CREDENTIAL

Without the extra quotes arround the password, I get the following error

A semicolon was expected at index 133 in the connection string.

Adding quotes arround the password that are not even part of the password works arround the issue, but certainly does not feel correct.

Thanks

christianwade commented 3 years ago

Just catching up. If still an issue, please raise a support ticket with either AAS/SSAS/Premium