<powershell>
$file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm")
New-Item $file -ItemType file
</powershell>
<persist>true</persist>
I did not achieve the expected results using the above code.
The expected file was not generated under this path C:\Windows\Temp\
in the instance
Your instance needs to install EC2Launch,and here is the Revised code:
<powershell> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force $file = $env:SystemRoot + "\Temp\" + (Get-Date).ToString("MM-dd-yy-hh-mm") New-Item $file -ItemType file </powershell> <persist>true</persist>