Last active
October 22, 2021 14:45
-
-
Save JustinGrote/02ac004ace5884cc97d8094ab0a92ff4 to your computer and use it in GitHub Desktop.
Better Example of using classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace Microsoft.Graph.PowerShell.Models | |
[MicrosoftGraphUser1]@{ | |
DisplayName = 'Some User' | |
UserPrincipalName = 'someuser@mycompany.com' | |
MailNickname = 'someuser@mycompany.com' | |
AccountEnabled = $true | |
PasswordProfile = [MicrosoftGraphPasswordProfile]@{ | |
Password = 'Pass@word1' | |
} | |
} | New-MgUser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pipeline works simply because -BodyParameter accepts pipeline input by Value, and since it is typed, it is easy to discover over the other parameter sets.