Executing Powershell script in an AWS EC2 Windows OS VM :: Script sent as UserData


i need create aws ec2 windows os vm has chef client installed on it. sending necessary script installing chef client through parameter userdata (http activity). once vm created, script should execute, download necessary files , complete installation.

i had done same aws ec2 linux vm, sending bash script in userdata. in first line of scipt had

#!bin/bash  -> tells interpreter execute commands  bash.

similarly have command tells windows vm commands should executed in powershell?

the script around 50 lines long. please let me know command create file , have scripts content of file? 


hi anish,

to run powershell script file, can save powershell cmdlets in notepad .ps1 file.

for difference between bash script , powershell script, please check article:

bash , powershell quick reference

i hope helps.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

RDS 2012 r2 collections show black screen and then close