msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Feature Request: Welcome Message Improvements
The welcome message is output as an object. Those with complex pipelines may get it introduced to "pollute" their output and that is difficult to troubleshoot, especially if they aren't intimately familiar with the process.
Instead, this should be adjusted to use Write-Host to go to the Information stream (Powershell 5.x+ which I assume is the target support surface) and then it can be suppressed with 6>$null, or even if not suppressed, it doesn't pollute the output stream.
Further, additional information on context would be nice to inform the user they did things right.
And an option switch e.g. -NoWelcome should be added for easy suppression for newer powershell users who may not understand they can suppress the information stream of the command with 6>$null
An example of what I think it should look like (ideally with a distinguishing color like Write-Host -foregroundcolor darkcyan)
Welcome to Microsoft Graph!
Connected via application using ClientId <CLientId>
Readme: https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/README.md
Graph Docs: https://docs.microsoft.com/en-us/graph/
NOTE: You can use the -NoWelcome parameter to suppress this message.
If this is tagged as up-for-grabs I'll be willing to attempt a PR
https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/2da264694549f2ed460ebe80f4ecb7e3762fb6c5/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs#L262 AB#7717
Any update on this? I am currently using Graph in Azure Automation and then passing the output (JSON) to a Logic App. The problem is the Welcome to Microsoft Graph message is being passed along with the JSON payload and causing the Logic App to fail.
Any update on this? I am currently using Graph in Azure Automation and then passing the output (JSON) to a Logic App. The problem is the Welcome to Microsoft Graph message is being passed along with the JSON payload and causing the Logic App to fail.
Want so second this. Really annoying issue. Is there any workaround?
Any update on this? I am currently using Graph in Azure Automation and then passing the output (JSON) to a Logic App. The problem is the Welcome to Microsoft Graph message is being passed along with the JSON payload and causing the Logic App to fail.
I got it to work. I did this:
#Connect to the Microsoft Graph using the acquired AccessToken
$connection = Connect-Graph -AccessToken $accessToken
$connection > $null
I had to put the connection into a variable. When I just did Connect-Graph -AccessToken $accessToken > $null it did not work
I have had the same issue multiple times. Would be nice if this gets fixed, it complicates all Script using MS Graph API.
You can pipe the command to Out-Null if you want to hide the message in your script:
Connect-MgGraph | Out-Null
We will add the -NoWelcome option in v2 version of the module.