I answered my own question. $object.PSObject.Copy() actually uses $object.Clone() if the base object is clonable
@jeffbrowntechКүн бұрын
Nice, thanks for sharing!
@GenePerryКүн бұрын
Great pace and content, the perfect intro to Graph API - thank you
@Adaption13 күн бұрын
Clean, concise, and well explained. Thank you, Jeff!
@WayneRoach-v8y14 күн бұрын
When will you be doing a video on how to get an access token from a client app to connect to MS Graph, without user intervention. (Assuming permissions have been setup already in Azure.)
@jeffbrowntech13 күн бұрын
I am not familiar with that process, but I will take it under consideration for a future video.
@nidhinnidhin876427 күн бұрын
Very Informative and Helpful Thanks
@marcdoliveira4906Ай бұрын
Outstanding Jeff. Thank you.
@drivetrainerYTАй бұрын
And you just demoed that. Happy to be close on one page
@drivetrainerYTАй бұрын
Oftentimes I use datetime for output files, plus something like current set page, counter etc, to make filename unique
@jeffbrowntechАй бұрын
All great ideas, thanks for sharing.
@drivetrainerYTАй бұрын
Thanks again. I just upgraded my simplistic one-block param() approach of stuffing everything between the parentheses into scripting structured self-documented param blocks with validation and custom err messages. You got a docile apprentice here :)
@drivetrainerYTАй бұрын
Happy to find this channel. Thank you for the perfect structuring and delivery. Definitely subscribed.
@jeffbrowntechАй бұрын
Awesome, thank you!
@chrismast2790Ай бұрын
Why bother putting quotes around the key names in your hash table?
@jeffbrowntechАй бұрын
Probably just a habit I picked up at one point for some reason and it's stuck 🤷♂️
@ashisharya65Ай бұрын
Great video as usual Jeff. Thanks for making it.
@jeffbrowntechАй бұрын
Thanks for watching!
@thearchibaldtuttleАй бұрын
Great stuff! Thank you for the video!
@jeffbrowntechАй бұрын
Glad you liked it!
@markhanna58242 ай бұрын
Great video - I have an idea for you. Many people have complained to MS that there isn't a bulk method for hiding chats (or leaving, deleting etc). For many of us this becomes a very tedious task. Can PS help? Thanks again!!
@jeffbrowntech2 ай бұрын
At a quick glance, that looks like it would take diving into the Teams API to find a user's chats and remove or soft-delete them.
@MalcolManan2 ай бұрын
You've got a like a sub. I have been trying to figure out how to assign permissions to the Managed Identity Service Principal and no useful information is available online. Cheers, keep up and good luck!
@jeffbrowntech2 ай бұрын
Glad it helped, and that's why I wrote the article and did the video. Seems like a complicated process and wanted to document it myself.
@samlegend60643 ай бұрын
What is the future of Microsoft Graph API, and how is Microsoft evolving it? Is investing in learning this skill for career growth a good idea?
@jeffbrowntech2 ай бұрын
Learning how to interact with any API is a good thing. Microsoft's Graph API is the gateway to managing all of its services directly. You can write your own code to perform actions or get information. I've used it when there wasn't a clear PowerShell cmdlet or it had limitations that querying the API directly was better.
@fabianzoon16483 ай бұрын
Thank you so much. It answered all of the questions I had. Really nice. tnx.
@jeffbrowntech2 ай бұрын
Great to hear!
@mattcargile3 ай бұрын
Off the jump, it looked like you could just use parameter sets for private. Haven’t finished video though.
@mattcargile3 ай бұрын
Oh nvm. It’s a parameter value you are keying on. I would just have a private channel switch maybe or another function. Dynamic param is nice too. I usually forget about it. Hmmm
@mattcargile3 ай бұрын
Hmmm. Yeah I see this simplifies UX while complicating for the dev. I think it is a win especially to reduce complexity. It might reduce discoverability in the help. I’m curious if private channel owner would show in the help.
@jeffbrowntech3 ай бұрын
For sure, multiple parameters to cover parameter sets, my goal here was to have one parameter for the channel name, channel type, then specify a private channel owner when needed. But definitely multiple ways to accomplish this.
@psjoshooaj3 ай бұрын
I dig regex for searching through logs or parsing native command output where the formatting isn't quite predictable. I also tend to use it with the "-replace" operator to either remove the text matching a pattern or transform it somehow. One of the most common uses for me though is within Visual Studio Code and doing a regex search, or find & replace, in a file or across all files in the repo. That is super helpful when you need to find a very specific pattern and change it everywhere.
@ashisharya653 ай бұрын
Thank you so much for making this video 🙏
@jeffbrowntech3 ай бұрын
Glad it was helpful!
@jeffbrowntech3 ай бұрын
How do you use regex and PowerShell together? Leave a comment below!
@SimonRNorton3 ай бұрын
Just the introduction I was looking for! Thank you so much!
@jeffbrowntech3 ай бұрын
You bet, glad it was helpful!
@FUNKYSASSMANN3 ай бұрын
Excellent video and demonstration!
@psjoshooaj3 ай бұрын
When I need to save some kind of state in a module, I’ll use a script scope variable as well. Typically I’ll explicitly declare that variable in my PSM1 so that there’s one place to go to know all script scope variables used in the module. And I’ll try to minimize the functions that touch the variable directly. Usually by having private get/set functions and ensuring that any other function that needs the variable will get it from the private function rather than accessing it directly. Depending on the circumstances, environment vars can fill a similar role except they’re available in the global scope making them transparently available to the user and any other script/module running in that session.
@jeffbrowntech3 ай бұрын
Do you create the variable outside all the functions in your PSM1 file? Did not think of that approach but I like it!
@psjoshooaj3 ай бұрын
@@jeffbrowntechExactly, not that it makes a _technical_ difference, but I know there is only one place to look to remember if/which script scope variables are being used and it feels more intentional. I also do a lot of C# code and it still feels dirty to declare a variable in an “inner scope” and then access it outside of that “scope” even though those try-block or if-block scopes are imaginary and don’t exist in PowerShell.
@jeffbrowntech3 ай бұрын
@@psjoshooaj I agree, I like the idea of having one place where the variable lives, then the get/set functions to control it. Thank you for sharing!
@hassenfepher3 ай бұрын
brand new to graph, and this video is where i started. i tried editing the department, and i got the following error. "code": "Authorization_RequestDenied", "message": "Insufficient privileges to complete the operation.", this was performed with the global admin for my account, and i confirmed i can edit this property in the azure identity portal i can pull these attributes just fine. do i have an application permission limitation in this explorer?
@hassenfepher3 ай бұрын
looks like i needed to add permissions in the permissions tab. i made it work. is there a way to grant these permissions temporarily? if i close the session, will the api permissions persist? should i manually revoke the permissions i just granted at the end of this exercise to reduce the attack surface until i get back into graph?
@jeffbrowntech3 ай бұрын
@@hassenfepher I believe those permissions are persistent, if you are unsure of leaving those out there, go ahead and revoke them.
@CoreTheBK2 ай бұрын
@@hassenfepherI could be wrong but JIT PAM solutions might be what you need for this sort of security you’re mentioning.
@francescosovis79383 ай бұрын
Thank you very much. Your instructions on the video are very useful.
@jeffbrowntech3 ай бұрын
Glad to hear that!
@psjoshooaj3 ай бұрын
That was a great tutorial on dynamic parameters! I've used them a couple of times, but I generally avoid them because of the added complexity for me and the reduced discoverability for users. For the example here with public vs private "Teams teams" I'm not sure whether I would come up with a way to use a second parameterset, or have two public commands like "New-PublicChannel" and "New-PrivateChannel" which delegate to a single private function to do the work (to minimize duplicate code). One of the things that holds me back from using dynamic parameters is the lack of platyPS support but if I remember correctly, I think Sean Wheeler mentioned platyPS v1 may have support for dynamic parameters and supposedly they're aiming to release v1 this year so it's definitely worth another look!
@jeffbrowntech3 ай бұрын
What do you think about dynamic parameters, is this something you would use?
@Team_vanquishing4 ай бұрын
Thanks, Jeff, for sharing your experiences. This is very motivating!
@Team_vanquishing4 ай бұрын
Thanks for sharing this information Jeff! Much needed and right on time!
@thearchibaldtuttle4 ай бұрын
Nice video, thank you!
@justin.emmons4 ай бұрын
This video was excellent Jeff. Light bulbs were going off while watching this. Honestly can't wait to go to work to try some of these!
@jeffbrowntech4 ай бұрын
Have you ever used or needed tab completion for your parameters? Leave a comment below!
@ashisharya654 ай бұрын
Hi Jeff, Please make the next video on Regex in PowerShell.
@jeffbrowntech4 ай бұрын
It's a good topic, it's on my to-do list.
@starvosxant43484 ай бұрын
This is terrible... Not the video. The video is great! But why this information is not easy to find in Microsoft Docs? They should have a atep by step guide like this... Anyway, thanks for your help! Why did the Graph series stopped?
@jeffbrowntech4 ай бұрын
That is primarily why I blogged about it and created the video, to put all the steps together. That's all I had for Graph stuff at the time but will produce more if something comes up. I primarily pull from things I encounter in my daily work.
@starvosxant43484 ай бұрын
@@jeffbrowntech could you bring more examples of using Python? The general step: register the app, request the token, use the API via requests/SDK
@jeffbrowntech4 ай бұрын
@@starvosxant4348 Unfortunately I don't know Python, PowerShell is my go-to scripting language for now.
@pawelhaubus1724 ай бұрын
Great video, when i run 'New-MgServicePrincipalAppRoleAssignment' i get the 'Insufficient privileges to complete the operation.' error, I can't figure out which permissions are missing, i created the function app,, i am also a global admin, but error comes up each time when itry to run it, any idea what m,ay be causing it?
@jeffbrowntech4 ай бұрын
Double check what scopes you have in your Microsoft Graph connection context, there should be something like Directory.ReadWrite.All: Get-MgContext | Select-Object -ExpandProperty Scopes
@pawelhaubus1724 ай бұрын
@@jeffbrowntech thanks for your replay, I managed to resolve my issue, At first I only used scope which you mentioned in the video 'Connect-MgGraph -Scopes 'Directory.ReadWrite.All'' but it did not work, only after adding 'AppRoleAssignment.ReadWrite.All' it started to work for me, so first command was "'Connect-MgGraph -Scopes 'Directory.ReadWrite.All', 'AppRoleAssignment.ReadWrite.All'" in my case Thanks for the comments!
@jeffbrowntech4 ай бұрын
Interesting, thank you for the update, glad you were able to figure it out! I don't believe I needed that permission previously but something could have changed in the requirements.
@andresjordan19064 ай бұрын
@@pawelhaubus172 Thank you for posting your solution, I was having the same issue until I came across your comment.
@dengsue4 ай бұрын
I dont see it on my end, can you help?
@jeffbrowntech4 ай бұрын
What specifically don't you see?
@susheel_dogra5 ай бұрын
You're amazing Jeff
@susheel_dogra5 ай бұрын
Thank you so much , It helped a lot !!
@jeffbrowntech5 ай бұрын
Glad it helped!
@ashisharya655 ай бұрын
Great video Jeff 👏
@MadiAnas-wc3xt5 ай бұрын
Is this possible via Terraform?
@jeffbrowntech5 ай бұрын
I have not personally done that but I can't think of any reason it couldn't be. You would have to know the app role to assign ahead of time. registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/app_role_assignment
@MadiAnas-wc3xt5 ай бұрын
@@jeffbrowntech This worked btw. Thank you! I needed to be Global Administrator not just Application Administrator. Not sure why yet. Need to work on that. ``` data "azuread_application_published_app_ids" "well_known" {} resource "azuread_service_principal" "msgraph" { client_id = data.azuread_application_published_app_ids.well_known.result.MicrosoftGraph use_existing = true } resource "azuread_app_role_assignment" "directory_read_all" { app_role_id = azuread_service_principal.msgraph.app_role_ids["Directory.Read.All"] principal_object_id = azurerm_user_assigned_identity.github.principal_id resource_object_id = azuread_service_principal.msgraph.object_id } ```
@garrettnelson84695 ай бұрын
Another great video Jeff!
@garrettnelson84696 ай бұрын
Great video Jeff! Splatting is such a handy feature.
@leeblack21036 ай бұрын
Thank you! Please help with JSON imports
@jeffbrowntech6 ай бұрын
Check out ConvertFrom-Json learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-json
@ashisharya656 ай бұрын
Thanks for making this video Jeff. ✌️
@derekbelanger78396 ай бұрын
Thanks for this! Ternary syntax is the same in Bicep so getting used to it is helpful for that onramp too!
@justin.emmons7 ай бұрын
Great stuff Jeff. I've never messed around with [void] and or Out-Null. I'm still a PS noon so much of the stuff I do is just Ah-Hoc. Is the main reason for Out-Null for performance?
@jeffbrowntech7 ай бұрын
This is the StackOverflow thread I referenced in the video: stackoverflow.com/questions/5260125/whats-the-better-cleaner-way-to-ignore-output-in-powershell The way I am using Out-Null seems to be slower but someone points out it may be due to the pipeline. Overall, we're talking milliseconds, but if you're script is long running and doing the operation millions of times, it could make a difference.
@justin.emmons7 ай бұрын
@@jeffbrowntech Thanks Jeff. Keep up the great work you're doing.
@ashisharya657 ай бұрын
This really keeps me motivated towards my goals, Jeff. 😊 Thank you for making this video 😊 I am also trying to switch to a complete Azure cloud engineer role and I am really working hard towards that goal and hope will get there in the coming months or might be there in a few years 😊
@ashisharya657 ай бұрын
Great video Jeff. Thanks for making this video. It has clear all my doubts related to Parameter sets. 😊
@ashisharya657 ай бұрын
Hi Jeff, Thanks for making this video. Please make a video sometime on how to play with Regex with PowerShell.
@jeffbrowntech7 ай бұрын
I am no regex expert but will see what I can put together.