Hey Brian,
Seems like the issue is with how the params are passed to the script over winrm. This leads me to some ambiguity I've had with proper formatting when it comes to Ansible's script module script params (that's a confusing description ha). There are a couple cases where I've had to do things like the following for proper execution (the three examples below, from other tasks, work):
# Had to use nested quotes to prevent the colon from path from tampering with how the param was read
- name: '[29/45] Create Reports_ui web application'
script: 'CreateApplication.ps1 Reports_ui "C:\web\path\Reports_ui" Reports_ui Company'
# Example of params that did not need any type of syntax adjustment
- name: '[28/45] Create Reports app pool'
script: CreateAppPool.ps1 Reports_ui True Classic v4.0
# Example of escaping backslash
- name: '[12/45] Create Company\chp folder'
script: CreateFolder.ps1 Company\\chp
Most of those were settled on after multiple trials, until a successful execution occurred. This leads me to the script that I opened this discussion about, and the original way in which I call it:
- name: '[37/45] Create AutoImportRoot virtual directory'
script: CreateVirtualDirectory.ps1 Company ui AutoImportRoot
So it doesn't have anything too fancy in terms of the params like some of the above examples have. But still, the script isn't running the same over winrm, and exceptions look parameter related. I saw on another thread that setting ANSIBLE_KEEP_REMOTE_FILES=1 would allow me to actually see the script executed on the host?