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
| $RoleDefinitions = @( | |
| @{ | |
| Name = 'Cosmos DB Built-in Data Reader' | |
| Id = '00000000-0000-0000-0000-000000000001' | |
| } | |
| @{ | |
| Name = 'Cosmos DB Built-in Data Contributor' | |
| Id = '00000000-0000-0000-0000-000000000002' | |
| } | |
| ) |
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
| # https://learn.microsoft.com/en-us/azure/app-service/deploy-ci-cd-custom-container?tabs=private&pivots=container-linux#4-enable-cicd | |
| $WebhookURL = '' | |
| $Username = $WebhookURL.Split('https://').Split(':')[1].Split('@')[0] | |
| $Password = $WebhookURL.Split('https://').Split(':')[2].Split('@')[0] | |
| $Headers = @{ 'Authorization' = "Basic $([Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$Username`:$Password")))" } | |
| Invoke-RestMethod -Method Post -Uri "https://$($WebhookURL.Split('@')[1])" -Headers $Headers -UserAgent 'powershell/1.0' |
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
| from bs4 import BeautifulSoup | |
| # path to the local file | |
| doc = "C:\\Users\\Ryland\\Desktop\\index.html" | |
| # open the file in read mode | |
| with open(doc, 'r') as f: | |
| content = f.read() | |
| # Initialize the object with the document |
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
| # Define variables | |
| $ResourceGroupName = '' | |
| $AppGatewayName = '' | |
| $ManagedIdentityName = '' | |
| $KeyVaultName = '' | |
| $KeyVaultCertficateName = '' | |
| # Get App Gateway and Managed Identity resource objects | |
| $AppGateway = Get-AzApplicationGateway -Name $AppGatewayName -ResourceGroupName $ResourceGroupName | |
| $ManagedIdentity = Get-AzUserAssignedIdentity -Name $ManagedIdentityName -ResourceGroupName $ResourceGroupName |
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
| $SubscriptionId = '' | |
| $ModelName = 'gpt-35-turbo*' | |
| $ResourceGroups = Get-AzResourceGroup | |
| foreach ($ResourceGroup in $ResourceGroups) { | |
| Write-Output "Processing Resource Group $($ResourceGroup.ResourceGroupName)" | |
| $Accounts = Get-AzCognitiveServicesAccount -ResourceGroupName $ResourceGroup.ResourceGroupName | Where-Object { $_.Properties.Endpoint -like '*openai.azure.com*' } | Select-Object -ExpandProperty CustomSubDomainName | |
| foreach ($Account in $Accounts) { | |
| Write-Output "Processing OpenAI Account $($Account)" |
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
| <# | |
| .SYNOPSIS | |
| This script will download all files from a specified SharePoint Document Library path. | |
| .EXAMPLE | |
| $ScriptParams = @{ | |
| SharePointTenant = 'mycompany.sharepoint.com' | |
| SiteName = 'mysite/my subsite' | |
| DocumentLibraryName = 'Documents' | |
| DocumentLibraryPath = 'my directory/my subdirectory' | |
| LastModifiedDate = (Get-Date '2024-01-01') |
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 New-MasterKeyAuthorizationSignature { | |
| <# | |
| .SYNOPSIS | |
| Generate Cosmos DB Master Key Authentication header for use with the NoSQL REST API. | |
| .EXAMPLE | |
| $AuthKeyParams = @{ | |
| Method = Post | |
| ResourceId = "dbs/$DatabaseId/colls/$CollectionId" | |
| Date = [DateTime]::UtcNow.ToString('r') | |
| MasterKey = $MasterKey |
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
| $StorageAccount = '' | |
| $Table = '' | |
| $PartitionKey = '' | |
| $RowKey = '' | |
| # Set Azure Table Storage request headers | |
| $Date = [DateTime]::UtcNow.ToString('R') | |
| $AzTableHeaders = @{ | |
| 'Accept' = 'application/json;odata=nometadata' | |
| 'x-ms-version' = '2020-08-04' |
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 the Immutable ID of the ADDS user | |
| $Name = 'My Name' | |
| $ADUser = Get-ADUser -Filter 'Name -like "*$Name*"' | |
| $ImmutableId = [System.Convert]::ToBase64String($ADUser.ObjectGUID.tobytearray()) | |
| # Connect to Azure AD | |
| Connect-AzureAD | |
| # Remove the duplicated user from Azure AD that was created when the ADDS user was first synced | |
| Remove-AzureADUser -ObjectId <duplicated AAD user ObjectId> |
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 -Version 5.1 | |
| # Install required module from PSGallery | |
| Install-Module -Name Microsoft.Xrm.Tooling.CrmConnector.PowerShell | |
| # Interactive Sign-in | |
| $CRMConn = Get-CrmConnection -InteractiveMode | |
| # Unattended Sign-in | |
| $Cred = New-Object System.Management.Automation.PSCredential ($UserName, $(ConvertTo-SecureString -String $Password -AsPlainText -Force)) |
NewerOlder