Debugging steps for Citrix XenApp running PowerShell Scripts

Ensure you are invoking appropriate version of PowerShell to run your PS script Use C:Windowssyswow64Windowspowershellv1.0powershell.exe for 32-bit Use C:Windowssystem32Windowspowershellv1.0powershell.exe for 64-bit When you are invoking 32-bit/64-bit script for the first time on the system, ensure that appropriate ExecutionPolicy is set for the environment. If ExecutionPolicy is set to restricted PS shell just exits after launch. In case if your script making any ADO connections, ensure that proper driver names are used for example: You’ll see “Driver={Microsoft Access Driver (*.mdb, *.accdb)}” on systems running Access application whereas on systems that don’t have Access installed the driver will be named as “Driver={Microsoft […]

Read more

PowerShell Script to Update MDB Database Using ADODB Object

Due to lack of command line tools to query/update the .MDB databases, one needs to opt to the ActiveX Data Object (ADO) automation to script the requirement. The much of the resources out on the web including MSFT TechNet Scripting Blogs, exemplifies this automation using “Microsoft.Jet.OLEDB.4.0” provider. Yet there are many articles reporting issues using this provider and specially resulting in "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))" error in PowerShell as I reported here. I figured out a better option to deal with this automation requirement on Windows x64-bit systems. It’s to use the Access DB DSN to connect […]

Read more

Fix: There is no script engine for file extension “.ps1”.

Error: ————————— Windows Script Host ————————— There is no script engine for file extension ".ps1". ————————— OK   —————————   Possible Cause and Fix: The scenario I encountered this error is when running a powershell script from wscript engine as given below:   Syntax that caused above error: wscript.exe "C:scriptslaunchapp.ps1"   Syntax that worked: wscript.exe "C:scriptslaunchapp.vbs"

Read more