output issues

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 5 years and 4 months 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.
Locked
User avatar
mqh77777
Posts: 252
Last visit: Mon Feb 26, 2024 10:07 am
Has voted: 1 time

Re: output issues

Post by mqh77777 »

thanks but prompting for a password will not work for our needs. I have piped my get-tpm to a .TXT file and I can read the .txt file and display the contents. But the issue is the data will display like this:

Code: Select all

PSComputerName            : targetPC RunspaceId                : ab733a29-fa1c-4057-80b9-082c7f890302 TpmPresent                : True TpmReady                  : False ManufacturerId            : 1464156928 ManufacturerIdTxt         : WEC  ManufacturerVersion       : 5.81  ManufacturerVersionFull20 : Not Supported for TPM 1.2 ManagedAuthLevel          : Full OwnerAuth                 : OwnerClearDisabled        : False AutoProvisioning          : Enabled LockedOut                 : False LockoutHealTime           : Not Supported for TPM 1.2 LockoutCount              : Not Supported for TPM 1.2 LockoutMax                : Not Supported for TPM 1.2 SelfTest                  : {255, 1, 2, 5...}
How do I make it display properly in the RTB?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: output issues

Post by jvierra »

Pleas go back and recopy the code I posted. It works and solves the issue. I have posted two methods.
User avatar
mqh77777
Posts: 252
Last visit: Mon Feb 26, 2024 10:07 am
Has voted: 1 time

Re: output issues

Post by mqh77777 »

I've tried all of your code and it does not work. This line produces no output. $richtextbox_output.Lines = $tpm_lines[0] | Out-String | %{$_ -replace '\0'} In fact using the .Lines produces no output. We can't prompt for a user\password. I can get it all into a .txt file but the RTB does not display the contents in a neat way.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: output issues

Post by jvierra »

Please use this code.

You did not go back and recopy the code I posted.
Attachments
Test-TPM.psf
(20.55 KiB) Downloaded 114 times
This topic is 5 years and 4 months 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.
Locked