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
| AzureActivity | |
| | where TimeGenerated >= ago(15d) | |
| and OperationNameValue == "Microsoft.ContainerService/managedClusters/agentpools/write" | |
| | project TimeGenerated, Level, CorrelationId, EventSubmissionTimestamp, ActivityStatusValue, Properties_d.message, Properties_d.resource |
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( | |
| [string]$ResourceGroupName | |
| ) | |
| $context = Get-AzContext | |
| $subName = $context.Subscription.Name | |
| $subId = $context.Subscription.Id | |
| if ($ResourceGroupName) { | |
| $uri = "/subscriptions/$($subId)/resourceGroups/$($ResourceGroupName)/resources?`$expand=createdTime&api-version=2021-04-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
| #requires -Version 7.2 | |
| <# | |
| .SYNOPSIS | |
| Azure DevOps REST API to get a results across an organization based on provided search text, just as you would in the web UI | |
| .NOTES | |
| https://learn.microsoft.com/en-us/rest/api/azure/devops/search/code-search-results/fetch-code-search-results?view=azure-devops-rest-7.1&tabs=HTTP#coderesult | |
| Based on provided answer from SO: https://stackoverflow.com/a/64973447/12974596 | |
| .EXAMPLE | |
| ./Search-AzureDevOpsCode.ps1 -OrganizationName Company -Project Enterprise -SearchFilter "ext:yml AND somestringvalue" -AzAccessToken (Get-AzAccessToken) |
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
| version: '3.7' | |
| services: | |
| sql17: | |
| container_name: 'sql17' | |
| platform: linux/amd64 | |
| image: | |
| mcr.microsoft.com/mssql/server:2017-latest | |
| environment: |
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 ImportExcel, Az.Accounts, Az.Compute | |
| <# | |
| .SYNOPSIS | |
| Retrieve region specific Sku details for Virtual Machines and Managed Disks into an Excel file | |
| .EXAMPLE | |
| ./Get-AzComputeResourceData.ps1 -Regions 'westus2','westus3' -ExcelFileName 'c:\temp\azComputeResourceSku.xlsx | |
| #> | |
| [cmdletbinding()] | |
| param( |
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 -Module Az.Resources | |
| #requires -Version 7 | |
| <# | |
| .SYNOPSIS | |
| Based on Get-AppRegistrationExpiration by Cj-Scott | |
| https://github.com/Cj-Scott/Get-AppRegistrationExpiration | |
| #> | |
| $applications = Get-AzADApplication | Where-Object { $_.KeyCredentials.DisplayName -gt 0 } | |
| $today = (Get-Date).ToUniversalTime() |
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
| param( | |
| [string]$Location, | |
| [string]$SubcriptionName | |
| ) | |
| $subObj = Get-AzSubscription -SubscriptionName $SubscriptionName | |
| Set-AzContext -SubscriptionObject $subObj | |
| $payload = @{ | |
| location = $location | |
| subscriptionIds = @("subscriptions/$($subObj.Id)") |
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( | |
| [string] | |
| $VMName | |
| ) | |
| $scriptBlock = { | |
| $clusterNetworkNames = Get-ClusterResource | Where-Object ResourceType -eq 'Network Name' | |
| foreach ($n in $clusterNetworkNames) { | |
| if ($n.Name -match 'SQL Network Name') { | |
| $hostValue = $n.Name.TrimStart('SQL Network Name (').TrimEnd(')') |
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 Find-MissingCommands { | |
| <# | |
| .SYNOPSIS | |
| Find missing commands between the dbatools.io/commands and dbatools Module public functions | |
| .PARAMETER ModulePath | |
| Path to dbatools local repository | |
| .PARAMETER CommandPagePath | |
| Full path to the index.html commands page (e.g. c:\git\web\commands\index.html) |
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
| #$PSDefaultParameterValues = @{ "*:Credential" = (Get-Secret username) } | |
| if ($psedition -ne 'Core') { | |
| [System.Net.ServicePointManager]::SecurityProtocol = @("Tls12", "Tls11", "Tls", "Ssl3") | |
| } | |
| function Prompt { | |
| $major = $PSVersionTable.PSVersion.Major | |
| $minor = $PSVersionTable.PSVersion.Minor | |
| $patch = $PSVersionTable.PSVersion.Patch | |
| if ($major -lt 6) { | |
| Write-Host "[PS $($major).$($minor)] [" -NoNewline |
NewerOlder