This file contains hidden or 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
| Function SlowView { | |
| process { $_; Start-Sleep -Milliseconds 500 } | |
| } |
This file contains hidden or 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
| /* | |
| * Description: Simple IO class for php CLI | |
| * Author: Mads Aune | |
| */ | |
| if(!defined("STDIN")) { define('STDIN', fopen('php://stdin', 'r')); } | |
| class CLI { | |
| public static function getLine($prompt = '') { | |
| echo $prompt . "> "; |
This file contains hidden or 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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$True)] | |
| [string] | |
| $TenantName, | |
| [Parameter(Mandatory=$True)] | |
| [string] | |
| $AppId, |
This file contains hidden or 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
| # Get lines of code in a powershell project | |
| # Inspiration: https://www.limilabs.com/blog/source-lines-of-code-count-using-powershell | |
| function Get-LinesOfCode { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter()] | |
| [string] | |
| $Path = "." | |
| ) |
This file contains hidden or 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
| (Get-ChildItem -File -Recurse | Get-Content | Select-String -Pattern 'resource "(azurerm_.+|azuread_.+)" ".*"' -AllMatches).Matches | | |
| ForEach-Object { $_.Groups[1].Value } | | |
| Sort-Object -Unique |
This file contains hidden or 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
| function Get-MIDServerDownloadUrl { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true)] | |
| [string[]] | |
| $InstanceName, | |
| [Parameter()] | |
| [ValidateSet("windows", "linux")] | |
| [string] |
This file contains hidden or 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
| PS> Find-MgGraphCommand -Uri "https://graph.microsoft.com/beta/users" | |
| APIVersion: beta | |
| Command Module Method URI OutputType Permissions | |
| ------- ------ ------ --- ---------- ----------- | |
| Get-MgUser Users GET /users IMicrosoftGraphUser1 {DeviceManagementApps.Read.All, DeviceManagementApps.… | |
| New-MgUser Users POST /users IMicrosoftGraphUser1 {DeviceManagementApps.ReadWrite.All, DeviceManagement… |
This file contains hidden or 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
| PS> Get-Command -Module Microsoft.Graph* "get*userprofile*" | |
| CommandType Name Version Source | |
| ----------- ---- ------- ------ | |
| Function Get-MgUserProfile 1.25.0 Microsoft.Graph.People | |
| Function Get-MgUserProfileAccount 1.25.0 Microsoft.Graph.People | |
| Function Get-MgUserProfileAddress 1.25.0 Microsoft.Graph.People | |
| Function Get-MgUserProfileAnniversary 1.25.0 Microsoft.Graph.People | |
| Function Get-MgUserProfileAward 1.25.0 Microsoft.Graph.People | |
| ... |
This file contains hidden or 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
| PS> Invoke-MgRestMethod -Method Get -Uri "https://graph.microsoft.com/beta/users" | |
| Name Value | |
| ---- ----- | |
| @odata.context https://graph.microsoft.com/beta/$metadata#users | |
| value {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, xxxxxxxx-xxxx-xxxx-xx… | |
| @odata.nextLink https://graph.microsoft.com/beta/users?$skiptoken=RFNwdAIAAQAAAB19Y3FybC8hcm6lLmZsYWRtYXJrQGdtYWls… |
This file contains hidden or 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
| # replace object_id with the 'Object ID' of your app registration | |
| Get-AzADAppPermission -ObjectId <object_id> |
OlderNewer