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.
User avatar
mqh777
Posts: 236
Joined: Tue Feb 25, 2014 1:01 pm

Re: output issues

Post by mqh777 » Wed Oct 31, 2018 7:52 am

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?

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: output issues

Post by jvierra » Wed Oct 31, 2018 10:22 am

Pleas go back and recopy the code I posted. It works and solves the issue. I have posted two methods.

User avatar
mqh777
Posts: 236
Joined: Tue Feb 25, 2014 1:01 pm

Re: output issues

Post by mqh777 » Wed Oct 31, 2018 10:59 am

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.

User avatar
jvierra
Posts: 13392
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: output issues

Post by jvierra » Wed Oct 31, 2018 11:07 am

Please use this code.

You did not go back and recopy the code I posted.
Attachments
Test-TPM.psf
(20.55 KiB) Downloaded 13 times

Locked