HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

Connect-OVMgmt always displays the Terms of Use banner #658

Closed dmoroney closed 11 months ago

dmoroney commented 11 months ago

Expected Behavior

There doesn't seem to be a way to turn off the Terms of Use banner. Is there a parameter or workaround for turning off or redirecting that output?

Actual Behavior

VERBOSE: [NEWOBJECT] Called from: Connect-OVMgmt
VERBOSE: [CONNECT-OVMGMT] Using default authentication directory: 'LOCAL'
This management appliance is a company owned asset and provided for the exclusive use of authorized personnel. Unauthorized use or abuse of this system may lead to corrective action including termination, civil and/or criminal penalties.

Use...requires prior authorization...

Steps to reproduce

$Connection = Connect-OVMgmt -Hostname ******** -Credential $pscredential -LoginAcknowledge -Verbose

Version Information

$PSLibraryVersion
appliance_name_hidden        LibraryVersion Path
----------------                    -------------- ----
ApplianceVersion: 8.40.00.480384.00 8.30.3534.1611 path_to\PowerShell\Modules\HPEOneView.830\8.30.3534.1611
$PSVersionTable
Name                           Value
----                           -----
PSVersion                      7.3.7
PSEdition                      Core
GitCommitId                    7.3.7
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
ChrisLynchHPE commented 11 months ago

This is not a bug, rather by design. If you do not want a message to be displayed, use the Set-OVLoginMessage to clear the value.

dmoroney commented 11 months ago

The interactive message makes sense. Unauthorized changing of the banner is a violation of company policy. The current work with HPEOneView.830 is to build a process that will perform automated tasks. I'll have to see how things work when I add the discovery tool as a scheduled command. If there's a workaround to redirect this output, then that would be okay.

ChrisLynchHPE commented 11 months ago

The message isn't put into the pipeline, so you should not have any issues with automating pipeline processing when the login message is presented.

dmoroney commented 10 months ago

I found the workaround to suppress the output from write-host in the .psm1.

./something.ps1 6> $null | put output into the pipeline

ChrisLynchHPE commented 10 months ago

Sure, but keep in mind that the text is for display only. It is not passed to the pipeline, so it will not cause an issue with anyone trying to process output.