Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 3 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I keep getting text errors from both a label and a text box similar to this:
ERROR: The property 'Text' cannot be found on this object. Verify that the property exists and can be set.
I looked over several different topics with similar issues and it may be something related to the scope of the script, but my understanding was this the script runs in a global scope. However, I did have to set up a $script:variableName in order for another variable to pass along the relevant details. I validated I am using the correct syntax with this basic one liner in the $formMain_Load section:
$textbox1.Text = "Status"
From that point it never updates with new $textbox1.Text data. Here's a small snippet in a $buttonLoad_Click event:
if ([string]::IsNullOrEmpty($Applications))
{
write-host "$computer,No Pending updates found." -ForegroundColor Yellow;
$textbox1.Text = "No pending updates found."
}
Then I get this message:
ERROR: The property 'Text' cannot be found on this object. Verify that the property exists and can be set.
ERROR: + CategoryInfo : InvalidOperation: (:) [], RuntimeException
ERROR: + FullyQualifiedErrorId : PropertyNotFound
ERROR: + PSComputerName : lhl385737
ERROR:
Hopefully I am used PS studio correctly and have this syntax in the right spot. If not, please enlighten me.
Thanks very much, good people.[Codebox=text file=Untitled.txt]
I figured out that the context missing the property is because I am using Invoke-Command on remote computers.
So I have tried out-host, result, and others to pull the $result out of the remote machine bring it back into the main session, but all of them seem to fail. I am aware this isn't a PS studio issue but is because of my own hack syntax, any help with this is would be greatly appreciated
This isn't the full script and some things are merely placeholders.
Omg, thanks very much. I saw this post scouring the network of networks and simply passed it by, however it worked. Somehow my logic from looking at all the other pages, it seemed to be out of context in my mind. Much appreciated.
Bill
This topic is 3 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.