Error when running powershell commands
I'm using vRA to deploy a blue print. Within the cloud-config section of the YAML code, I'm attempting to run PowerShell commands.
cloudConfig: |
#ps1_sysnative
new-item -Path 'c:\myfolder' -itemtype directory
Copy-Item -Path '\\p10ittech01\vRATest\Hashing-2.1.exe' -Destination 'c:\myfolder'
install-windowsFeature -name web-server -includeManagementTools
Set-NetfirewallProfile -Profile Domain,Public,Private -Enabled False
The PS commands are unsuccessful and I receive the following error message in the logs: 2020-07-17 11:49:23.169 2160 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdataplugins.heat.HeatPlugin' loadclass C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init [-] plugin 'UserDataPlugin' failed with error 'while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3': yaml.scanner.ScannerError: while scanning a simple key 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init [-] while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3: yaml.scanner.ScannerError: while scanning a simple key in "<byte string="">", line 8, column 3 could not find expected ':' in "<byte string="">", line 9, column 3 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init Traceback (most recent call last): 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\init.py", line 67, in _execplugin 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init shareddata) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 57, in execute 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init return self.processuserdata(userdata, service) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 126, in _processuserdata 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init return self.processnonmultipart(userdata, service) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdata.py", line 203, in processnonmultipart 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init retval = cloudconfigplugin.processnonmultipart(userdata) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdataplugins\cloudconfig.py", line 110, in processnonmultipart 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init executor = CloudConfigPluginExecutor.fromyaml(part) 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\userdataplugins\cloudconfig.py", line 65, in fromyaml 2020-07-17 11:49:23.169 2160 ERROR cloudbaseinit.init content = yaml.load(stream, Loader=loader) 2020-07-17 11:49:23 ...