Difference between revisions of "Background Jobs (PowerShell)"

Jump to navigation Jump to search
m
→‎Gotchas: Rewording of "VMware PowerCLI 64 bit"
(Undo revision 1853 by Sstrutt (talk) - Overwrote page with incorrect content)
m (→‎Gotchas: Rewording of "VMware PowerCLI 64 bit")
Line 105: Line 105:
** The background job script runs in a new context, therefore it runs in the default path.  If you tend to run your scripts from a non-default path, and need to read/write files, get the current directory using <code>Get-Location</code> and pass it to your job as a parameter, then use <code>Set-Location</code> in your job.
** The background job script runs in a new context, therefore it runs in the default path.  If you tend to run your scripts from a non-default path, and need to read/write files, get the current directory using <code>Get-Location</code> and pass it to your job as a parameter, then use <code>Set-Location</code> in your job.
* '''VMware PowerCLI 64 bit'''
* '''VMware PowerCLI 64 bit'''
** Due to a bug you can't launch background jobs against VMware vSphere (VI4) hosts in a 64-bit environment, PowerShell will crash.  Its probably a bug in PowerCLI, and will hopefully be fixed in a future release (bug exists in v4.1u1 and possibly other versions)You can run scripts in 32-bit (see [[Getting_Started_(PowerShell)#Useful_One-Liners|Useful One-Liners]] on how to detect in your script).
** Due to a bug you can't launch [[:Category:PowerCLI|VMware PowerCLI]] background jobs when running in a 64-bit environment.  Doing so cause launched PowerShell instances to exhibit high CPU and memory usage and eventually PowerShell will crash.  Whether its a problem in PowerShell or in PowerCLI is unclear (though I suspect PowerShell), the problem definitely effects PowerCLI v4.1u1 and v5, and probably affects all versions.
** Therefore launch from 32-bit PowerCLI shellTo run scripts in 32-bit see [[Getting_Started_(PowerCLI)#Force_32-bit|Force 32-Bit]], to detect in a script see [[Getting_Started_(PowerShell)#Useful_One-Liners|Useful One-Liners]].


[[Category:PowerShell]]
[[Category:PowerShell]]

Navigation menu