diff --git a/nested/sql-vm.json b/nested/sql-vm.json index adde041..84418c3 100644 --- a/nested/sql-vm.json +++ b/nested/sql-vm.json @@ -48,7 +48,7 @@ "variables": { "vmStorageAccountContainerName": "vhds", "OSDiskName": "sql-vm-osdisk", - "psToolkitFileName": "NetApp_PowerShell_Toolkit_4.3.0.msi" + "psToolkitScriptName": "InstallNetAppPS.ps1" }, "resources": [{ "type": "Microsoft.Storage/storageAccounts", @@ -153,9 +153,9 @@ "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ - "[concat(parameters('_artifactsLocation'),'/scripts/',variables('psToolkitFileName'),parameters('_artifactsLocationSasToken'))]" + "[concat(parameters('_artifactsLocation'),'/scripts/',variables('psToolkitScriptName'),parameters('_artifactsLocationSasToken'))]" ], - "commandToExecute": "start /wait msiexec.exe /i NetApp_PowerShell_Toolkit_4.3.0.msi /qn ADDLOCAL=F.PSTKDOT" + "commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File',' ', variables('psToolkitScriptName'))]" } } }] diff --git a/scripts/InstallNetAppPS.ps1 b/scripts/InstallNetAppPS.ps1 new file mode 100644 index 0000000..7e11878 --- /dev/null +++ b/scripts/InstallNetAppPS.ps1 @@ -0,0 +1,5 @@ +New-Item C:\NetApp -Type Directory +$WebClient = New-Object System.Net.WebClient +$WebClient.DownloadFile("https://raw.githubusercontent.com/SpektraSystems/NetAppAzureQuickstart/master/scripts/NetApp_PowerShell_Toolkit_4.3.0.msi","C:\NetApp\NetApp_PowerShell_Toolkit_4.3.0.msi") +# Start-Process msiexec.exe -Wait -ArgumentList '/I C:\NetApp\NetApp_PowerShell_Toolkit_4.3.0.msi /quiet' +Invoke-Command -ScriptBlock { & cmd /c "msiexec.exe /i C:\NetApp\NetApp_PowerShell_Toolkit_4.3.0.msi" /qn ADDLOCAL=F.PSTKDOT} diff --git a/scripts/netapp_connect_ontap_win.ps1 b/scripts/netapp_connect_ontap_win.ps1 index 05e1004..38a37d2 100644 --- a/scripts/netapp_connect_ontap_win.ps1 +++ b/scripts/netapp_connect_ontap_win.ps1 @@ -285,11 +285,18 @@ $scriptlogfilepath = 'C:\WindowsAzure\Logs\SQLNetApp_Connect_Storage.ps1.txt' (get-content $azurelogfilepath) | % { $_ -replace $password, 'passwordremoved' } | set-content $azurelogfilepath (get-content $scriptlogfilepath) | % { $_ -replace $password, 'passwordremoved' } | set-content $scriptlogfilepath } - +function Install-NetAppPSToolkit([String]$password) +{ +New-Item C:\NetApp -Type Directory +$WebClient = New-Object System.Net.WebClient +$WebClient.DownloadFile("https://raw.githubusercontent.com/SpektraSystems/NetAppAzureQuickstart/master/scripts/NetApp_PowerShell_Toolkit_4.3.0.msi","C:\NetApp\NetApp_PowerShell_Toolkit_4.3.0.msi") +Invoke-Command -ScriptBlock { & cmd /c "msiexec.exe /i C:\NetApp\NetApp_PowerShell_Toolkit_4.3.0.msi" /qn ADDLOCAL=F.PSTKDOT} +} ## Starting functions execution $SVMPwd = $OTCpassword +Install-NetAppPSToolkit Get-ONTAPClusterDetails $email $password $ocmip Connect-ONTAP $AdminLIF $iScSILIF $SVMName $SVMPwd $Capacity Load-SampleDatabase