Hi,
I a creating a script that needs to do the following thing.
I us Sapien Powershell 2017 Editor for this because it has a form with info on it
check if a TAG exists (GET-TAG)
$TagInfo = Get-Tag -Name $paramClassName .
This works perfect. I get the info of the TAG if it exists and a $null if the TAG does not exist.
if the TAG does not exist, creat it.
$MyClassTAG = Get-TagCategory -name "Class" | New-Tag -name $paramClassName -Verbose -Debug -Confirm:$false
The TAG is created but the script does not continue, it stays in the NEW-TAG cmdlet...
with the VERBOSE option I get following output
VERBOSE: 07/01/2018 22:43:01 New-Tag Started executionVERBOSE: Create tag 'ECCS-Classroom-GERTGERT-1' in category 'Class'
VERBOSE: 07/01/2018 22:43:01 New-Tag Started execution
VERBOSE: Create tag 'MyTAG' in category 'Class'
The next command, writing a status update in a text filed is never executed. if I comment out the NEW-TAG command line, the status is written correctly
Working with lates vCenter 6.5 and ESXi, on a windows 10 machine with latest PowerCLI modules installed.
Sapien Powershell Studio 2017 latest version 64 bit
Windows Enterprise 10 6bit, updated on januari 2017
PowerCLI Version
----------------
VMware PowerCLI 6.5.1 build 5377412
---------------
Component Versions
---------------
VMware Cis Core PowerCLI Component 6.5 build 6983166
VMware VimAutomation Core PowerCLI Component 6.5 build 6234650
Can someone tell me what I am doing wrong?
Thanks
Gert
PowerCLI - New-TAG hangs in a script
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PowerCLI - New-TAG hangs in a script
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
Some cmdlets that depend on events internally may get hang up on a GUI because the pipeline / messaging held up by the form. You can try creating the tag using a Job instead and see if that works (Look at the Job Tracker control sets, such as Button - Start Job).
https://info.sapien.com/index.php/guis/ ... sive-forms
Some cmdlets that depend on events internally may get hang up on a GUI because the pipeline / messaging held up by the form. You can try creating the tag using a Job instead and see if that works (Look at the Job Tracker control sets, such as Button - Start Job).
https://info.sapien.com/index.php/guis/ ... sive-forms
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PowerCLI - New-TAG hangs in a script
If you use "Debug" the command can stop in the debugger. You should not use "Debug" in PSS or in a form for this issue.
Also be sure you are using STA model.
David's suggestion will help to decouple from PSS settings but be sure code works at a CLI prompt.
Also be sure you are using STA model.
David's suggestion will help to decouple from PSS settings but be sure code works at a CLI prompt.