Merge pull request #9 from s7oneyuk/master
Added ability to launch 64bit powershell scripts
This commit is contained in:
commit
131c884b49
@ -55,6 +55,22 @@ class UserDataPlugin(base.BasePlugin):
|
||||
args = ['powershell.exe', '-ExecutionPolicy', 'RemoteSigned',
|
||||
'-NonInteractive', target_path]
|
||||
shell = False
|
||||
elif re.search(r'^#ps1_sysnative\s', user_data, re.I):
|
||||
if os.path.isdir(os.path.expandvars("%windir%")
|
||||
+ "\\sysnative\\WindowsPowerShell\\v1.0\\"):
|
||||
target_path += '.ps1'
|
||||
args = [os.path.expandvars("%windir%")
|
||||
+ '\\sysnative\\WindowsPowerShell\
|
||||
\\v1.0\\powershell.exe',
|
||||
'-ExecutionPolicy',
|
||||
'RemoteSigned', '-NonInteractive', target_path]
|
||||
shell = False
|
||||
else:
|
||||
# Unable to validate sysnative presence
|
||||
LOG.warning('Unable to validate sysnative folder presence.\
|
||||
If Target OS is Server 2003, please ensure you have\
|
||||
KB942589 installed')
|
||||
return (base.PLUGIN_EXECUTION_DONE, False)
|
||||
else:
|
||||
# Unsupported
|
||||
LOG.warning('Unsupported user_data format')
|
||||
|
Loading…
x
Reference in New Issue
Block a user