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
# Set-PSDBDefaults can be used to set the subscription in current context and allows you to set the function | |
# default parameters such as resource group name, server name and database name | |
#region Export database | |
Set-PSDBDefaults -Subscription "mySubscription01" | |
$password = Get-PSDBKVSecret -VaultName "kv-01" -SecretName "sqlpassword" | |
$exportParams = @{ |
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 | |
Import-Module psAzD | |
# set default parameters | |
$params = @{ | |
Organization = "myOrganization" | |
Project = "Test" | |
PersonalAccessToken = "Azure DevOps Personal Access Token here" | |
} | |
Set-AzDDefaultParameters @params |
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 Remove-AzureSqlBacPacFiles { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[ValidateRange(1,180)] | |
[int] $RetentionPeriod = 15 | |
) | |
begin { | |
# initialise function variable |
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 Export-AzureWebAppLogFiles { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] | |
$AppServiceName, | |
[Parameter(Mandatory = $true)] | |
[string] | |
$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
function LogParser { | |
# this comes in analysis section; So, need a place to store the files. | |
# We need a separate function to list this. | |
# Intended to run in pipeline | |
$report = @() | |
$files = Get-ChildItem -Path $PWD.Path -Filter "*.log" | |
foreach ($file in $files) { | |
$contents = Get-Content -Path $file.FullName | Select-Object -Skip 2 |
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 Export-Html { | |
[CmdletBinding(DefaultParameterSetName='Page')] | |
param( | |
[Parameter(ValueFromPipeline=$true)] | |
[psobject] | |
${InputObject}, | |
[Parameter(Position=0)] | |
[System.Object[]] |
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 Export-AzureWebAppLogFiles { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string] | |
$AppServiceName, | |
[Parameter(Mandatory = $true)] | |
[string] | |
$ResourceGroupName, |