bottkars / vmxtoolkit

vmxtoolkit is the Powershell extension to VMware Workstation
Apache License 2.0
116 stars 32 forks source link

Cannot suppress vmxtoolkit messages on import #13

Closed thorstenkampe closed 6 years ago

thorstenkampe commented 6 years ago

vmxtoolkitinit uses Write-Host to show debug messages on import. Using Write-Host means that messages cannot be suppressed using > or | Out-Null. The correct way would be in my opinion to use Write-Output or Write-Information.

> Import-Module vmxtoolkit
trying to get os type ...
 ==>Product Name: Windows
 ==>running vmxtoolkit for win_x86_64
 ==>vmrun is C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe
 ==>vmwarepath is C:\Program Files (x86)\VMware\VMware Workstation
 ==>virtual machine directory from module load is F:\cygwin\home\thorsten\Documents\Virtual Machines\
 ==>default vmxdir is F:\cygwin\home\thorsten\Documents\Virtual Machines\
 ==>running VMware Version Mode 14.1.1.7528167
 ==>OVFtool is C:\Program Files (x86)\VMware\VMware Workstation\OVFTool\ovftool.exe
 ==>Packertool is C:\Program Files (x86)\VMware\VMware Workstation\7za.exe
 ==>vdisk manager is C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe
 ==>webrequest tool is .Net
 ==>isotool is C:\Program Files (x86)\VMware\VMware Workstation/mkisofs.exe
bottkars commented 6 years ago

write-host is to send messages to the Powershell hots / console. Write output send´s output (objects) to the output pipeline, write-information( from PSv5 onwards ) can be used to add messages to the output pipeline. so whenever we w<ant to generate a informational text, we use write-host and/or write-verbose

thorstenkampe commented 6 years ago

I understand.

Unfortunately this doesn't address my primary concern: what are the messages on import intended for? If the output on import is of an informational or verbose character then I would suggest using Write-Verbose.

For context: all other third party modules I use are completely silent on import.

bottkars commented 6 years ago

write verbose should be used for verbosing / detailed Information during Evaluations / processing. write-host here Displays the results for various loads on operating System during initialization. if you do not want the info, Redirect consolehost . i do not understand you concern at all. does the out generate headached to you ?

thorstenkampe commented 6 years ago

As stated above: all other PowerShell modules I use do not display any kind of information during import. As such I do not understand the intended purpose: should I verify that information?

I was under the impression that the character of the output was somehow informational or "verbose". In that case I suggested using Write-Information or Write-Verbose.

If you think the output gives the user necessary information, then please close this ticket/keep it closed.

Thanks, Thorsten