Functions/Administration/Get-CdsBackup.ps1
<#
.SYNOPSIS Retrieve backup infos #> function Get-CdsBackup { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [String] $InstanceDomainName, [Parameter(Mandatory = $true)] [String] $BackupLabel ) begin { $StopWatch = [System.Diagnostics.Stopwatch]::StartNew(); Trace-CdsFunction -Name $MyInvocation.MyCommand.Name -Stage Start -Parameters ($MyInvocation.MyCommand.Parameters); Assert-CdsIsAdmin; } process { $instance = Get-CdsInstance -Name $InstanceDomainName; $backupData = Get-PowerAppEnvironmentBackups -EnvironmentName $instance.EnvironmentName; $backups = $backupData.value; $backup = $backups | Where-Object -Property "label" -EQ -Value $BackupLabel; $backup; } end { $StopWatch.Stop(); Trace-CdsFunction -Name $MyInvocation.MyCommand.Name -Stage Stop -StopWatch $StopWatch; } } Export-ModuleMember -Function Get-CdsBackup -Alias *; |