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
| #requires -modules "PnP.PowerShell" | |
| # requires SharePoint > application > sites.fullcontrol.all permissions | |
| $sites = "https://m365cpi68930152.sharepoint.com/sites/security-policies1", | |
| "https://m365cpi68930152.sharepoint.com/sites/security-policies2" | |
| $timestamp = Get-Date -Format FileDateTime | |
| foreach( $site in $sites ) |
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
| #requries -modules "Microsoft.PowerApps.Administration.PowerShell" | |
| function Get-AuthorizationHeader | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| [string] | |
| $EnvironmentUrl |
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
| kind: AdaptiveDialog | |
| beginDialog: | |
| kind: OnActivity | |
| id: main | |
| condition: =DateDiff(DateAdd(Coalesce(Global.UserProfile.LastRefreshed,Now()), 1440, TimeUnit.Minutes), Now(),TimeUnit.Minutes) > 0 | |
| type: Message | |
| actions: | |
| - kind: BeginDialog | |
| id: 0FnaSJ | |
| input: {} |
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
| Import-Module -Name "Microsoft.PowerPlatform.EnterprisePolicies" -ErrorAction Stop | |
| Connect-AzAccount | |
| $tenantId = "<YOUR TENANT ID>" | |
| $environmentId = "<ENVIRONMENT ID>" | |
| $hostname = "dc.services.visualstudio.com" | |
| Test-DnsResolution ` | |
| -EnvironmentId $environmentId ` |
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
| # taken from -- https://www.powershellgallery.com/packages/AzurePowerShellUtilityFunctions | |
| function Send-AppInsightsEventTelemetry | |
| { | |
| <# | |
| .SYNOPSIS | |
| Sends custom event telemetry to an Azure Application Insights instance. | |
| .DESCRIPTION | |
| Sends custom event telemetry to an Azure Application Insights instance. This function uses the Azure Application Insights REST API instead of a compiled client library, so it works without additional dependencies. |
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-InstalledModule -Name Az.* | ForEach-Object -Process { Get-InstalledModule -Name $_.Name -AllVersions | Uninstall-Module -Force -Verbose } | |
| Get-InstalledModule -Name Az -AllVersions | Uninstall-Module -Force -Verbose |
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
| Import-Module -Name "Microsoft.PowerPlatform.EnterprisePolicies" -ErrorAction Stop | |
| Import-Module -Name "Microsoft.PowerApps.Administration.PowerShell" -ErrorAction Stop | |
| # connect to az and power platform as user with the Power Platform Admin role | |
| Add-PowerAppsAccount -ErrorAction Stop | |
| Connect-AzAccount -ErrorAction Stop | Out-Null | |
| # get all environments with an enterprise policy applied |
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
| #requires -modules "Microsoft.PowerApps.Administration.PowerShell" | |
| function Get-FirstDayOfMonthDate | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| ) | |
| $month = [DateTime]::Today.Month |
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
| # Credit belongs to https://mgwdevcom.wordpress.com/2025/06/09/verifying-sharepoint-file-integrity-with-quickxorhash-in-powershell/ | |
| # made small updates to support PowerShell 5.1 | |
| function Get-QuickXorHash | |
| { | |
| param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [string] | |
| $FilePath |
NewerOlder