Remove-PowerApp-Admin
PowerApps Admin: Removes an app
#Requires -Version 5.1
#Requires -Modules Microsoft.PowerApps.Administration.PowerShell
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[pscredential]$PACredential,
[Parameter(Mandatory = $true)]
[string]$AppName,
[Parameter(Mandatory = $true)]
[string]$EnvironmentName,
[string]$ApiVersion
)
Process {
try {
ConnectPowerApps -PAFCredential $PACredential
$cmdArgs = @{ ErrorAction = 'Stop'; AppName = $AppName; EnvironmentName = $EnvironmentName }
if ($PSBoundParameters.ContainsKey('ApiVersion')) { $cmdArgs.Add('ApiVersion', $ApiVersion) }
$result = Remove-AdminPowerApp @cmdArgs -ErrorAction Stop | Select-Object *
if ($null -ne $result) { $result | Add-Member -NotePropertyName Timestamp -NotePropertyValue (Get-Date -Format "yyyy-MM-dd HH:mm:ss") -PassThru -Force }
}
catch { throw }
finally { DisconnectPowerApps }
}PowerApps credentials for authentication
The app identifier
The app's environment
API version to call