In GCP cloud I would like to deploy and then configure Windows Server using gcloud startup script. I have PowerShell script (for Windows Server configuration) prepared and tested. I have uploaded this PowerShell script into Cloud Storage. I have prepared gcloud command script for VM deployment (gcloud command script I have saved as a .sh script). I uploaded this .sh script into the Cloud Shell. In .sh script I am using metadata startup script section--metadata=startup-script-url="gs://bucketName/Server-Configuration-Script.ps1
. in Server-Configuration-Script.ps1
PowerShell script I have 4 parameters that I have to pass, below srcipt params.
param (
[Parameter(Mandatory=$true)][string] $paramA,
[Parameter(Mandatory=$true)][string] $paramB,
[Parameter(Mandatory=$true)][string] $paramC,
[Parameter(Mandatory=$true)][string] $paramD
)
My question is how can I use all four parameters in a startup script section --metadata=startup-script-url="gs://bucketName/Server-Configuration-Script.ps1
in my .sh script?
--metadata=startup-script-url="gs://bucketName/Server-Configuration-Script.ps1 -paramA -paramB -paramC -paramD
, but I am nor sure how to create this command, how to pass parama paramA...D. – tester81