Skip to content

Commit

Permalink
AzBobbyTables fixes
Browse files Browse the repository at this point in the history
Replace AzDataTableRow with AzDataTableEntity
  • Loading branch information
JohnDuprey committed Mar 25, 2023
1 parent cdee014 commit 517238c
Show file tree
Hide file tree
Showing 27 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Applications_GetQueue/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ param($name)

$Table = Get-CippTable -tablename 'apps'

$Object = (Get-AzDataTableRow @Table).RowKey
$Object = (Get-AzDataTableEntity @Table).RowKey
$object
6 changes: 3 additions & 3 deletions Applications_Upload/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param($name)
$Table = Get-CippTable -tablename 'apps'
$Filter = "PartitionKey eq 'apps' and RowKey eq '$name'"
Set-Location (Get-Item $PSScriptRoot).Parent.FullName
$ChocoApp = (Get-AzDataTableRow @Table -filter $Filter).JSON | ConvertFrom-Json
$ChocoApp = (Get-AzDataTableEntity @Table -filter $Filter).JSON | ConvertFrom-Json
$intuneBody = $ChocoApp.IntuneBody
$tenants = if ($chocoapp.Tenant -eq "AllTenants") {
(Get-tenants).defaultDomainName
Expand All @@ -28,9 +28,9 @@ $ContentBody = ConvertTo-Json @{
size = [int64]$intunexml.ApplicationInfo.UnencryptedContentSize
sizeEncrypted = [int64]($intunewinFilesize).length
}
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
$RemoveCacheFile = if ($chocoapp.Tenant -ne "AllTenants") {
Remove-AzDataTableRow @Table -Entity $clearRow
Remove-AzDataTableEntity @Table -Entity $clearRow
}
else {
$Table.Force = $true
Expand Down
2 changes: 1 addition & 1 deletion BestPracticeAnalyser_List/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -

$Tenants = Get-Tenants
$Table = get-cipptable 'cachebpa'
$Results = (Get-AzDataTableRow @Table) | ForEach-Object {
$Results = (Get-AzDataTableEntity @Table) | ForEach-Object {
$_.UnusedLicenseList = @(ConvertFrom-Json -ErrorAction silentlycontinue -InputObject $_.UnusedLicenseList)
$_
}
Expand Down
2 changes: 1 addition & 1 deletion DomainAnalyser_GetTenantDomains/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ foreach ($Exclude in $ExcludedTenants) {
$CleanupCount = ($CleanupRows | Measure-Object).Count
if ($CleanupCount -gt 0) {
Write-LogMessage -API 'DomainAnalyser' -tenant $Exclude.defaultDomainName -message "Cleaning up $CleanupCount domain(s) for excluded tenant" -sev Info
Remove-AzDataTableRow @DomainTable -Entity $CleanupRows
Remove-AzDataTableEntity @DomainTable -Entity $CleanupRows
}
}

Expand Down
2 changes: 1 addition & 1 deletion ExecBECCheck/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param($Request, $TriggerMetadata)
$body = if ($request.query.GUID) {
$Table = Get-CippTable -tablename 'cachebec'
$Filter = "PartitionKey eq 'bec' and RowKey eq '$($request.query.GUID)'"
$JSONOutput = Get-AzDataTableRow @Table -Filter $Filter
$JSONOutput = Get-AzDataTableEntity @Table -Filter $Filter
if (!$JSONOutput) {
@{ Waiting = $true }
}
Expand Down
4 changes: 2 additions & 2 deletions ExecExcludeTenant/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ $TenantsTable = Get-CippTable -tablename Tenants
try {
if ($Request.Query.List) {
$ExcludedFilter = "PartitionKey eq 'Tenants' and Excluded eq true"
$ExcludedTenants = Get-AzDataTableRow @TenantsTable -Filter $ExcludedFilter
$ExcludedTenants = Get-AzDataTableEntity @TenantsTable -Filter $ExcludedFilter
Write-LogMessage -API $APINAME -user $request.headers.'x-ms-client-principal' -message 'got excluded tenants list' -Sev 'Info'
$body = @($ExcludedTenants)
}
elseif ($Request.query.ListAll) {
$ExcludedTenants = Get-AzDataTableRow @TenantsTable
$ExcludedTenants = Get-AzDataTableEntity @TenantsTable
Write-LogMessage -API $APINAME -user $request.headers.'x-ms-client-principal' -message 'got excluded tenants list' -Sev 'Info'
$body = @($ExcludedTenants | Where-Object -Property defaultDomainName -NE $null)
}
Expand Down
2 changes: 1 addition & 1 deletion ExecPasswordConfig/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'

$Table = Get-CIPPTable -TableName Settings
$PasswordType = (Get-AzDataTableRow @Table)
$PasswordType = (Get-AzDataTableEntity @Table)

# Write to the Azure Functions log stream.
Write-Host 'PowerShell HTTP trigger function processed a request.'
Expand Down
2 changes: 1 addition & 1 deletion ExecRunBackup/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ try {
}
$CSVfile = foreach ($CSVTable in $BackupTables) {
$Table = Get-CippTable -tablename $CSVTable
Get-AzDataTableRow @Table | Select-Object *, @{l = 'table'; e = { $CSVTable } }
Get-AzDataTableEntity @Table | Select-Object *, @{l = 'table'; e = { $CSVTable } }
}
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Created backup" -Sev "Debug"

Expand Down
2 changes: 1 addition & 1 deletion ExecSAMSetup/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ try {

}
4 {
Remove-AzDataTableRow @Table -Entity $Rows
Remove-AzDataTableEntity @Table -Entity $Rows

$step = 5
$Results = @{"message" = "Installation completed. You must perform a token cache clear. For instructions click "; step = $step ; url = "https://cipp.app/docs/general/troubleshooting/#clear-token-cache"
Expand Down
36 changes: 18 additions & 18 deletions GraphHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Get-GraphToken($tenantid, $scope, $AsApp, $AppID, $refreshToken, $Retur
# Track consecutive Graph API failures
$TenantsTable = Get-CippTable -tablename Tenants
$Filter = "PartitionKey eq 'Tenants' and (defaultDomainName eq '{0}' or customerId eq '{0}')" -f $tenantid
$Tenant = Get-AzDataTableRow @TenantsTable -Filter $Filter
$Tenant = Get-AzDataTableEntity @TenantsTable -Filter $Filter
if (!$Tenant.RowKey) {
$donotset = $true
$Tenant = [pscustomobject]@{
Expand All @@ -94,7 +94,7 @@ function Get-GraphToken($tenantid, $scope, $AsApp, $AppID, $refreshToken, $Retur
}
$Tenant.GraphErrorCount++

if (!$donotset) { Update-AzDataTableRow @TenantsTable -Entity $Tenant }
if (!$donotset) { Update-AzDataTableEntity @TenantsTable -Entity $Tenant }
throw "$($Tenant.LastGraphError)"
}
}
Expand Down Expand Up @@ -153,7 +153,7 @@ function New-GraphGetRequest {
# Track consecutive Graph API failures
$TenantsTable = Get-CippTable -tablename Tenants
$Filter = "PartitionKey eq 'Tenants' and (defaultDomainName eq '{0}' or customerId eq '{0}')" -f $tenantid
$Tenant = Get-AzDataTableRow @TenantsTable -Filter $Filter
$Tenant = Get-AzDataTableEntity @TenantsTable -Filter $Filter
if (!$Tenant) {
$Tenant = @{
GraphErrorCount = 0
Expand All @@ -175,13 +175,13 @@ function New-GraphGetRequest {
if ($Message -ne 'Request not applicable to target tenant.') {
$Tenant.LastGraphError = $Message
$Tenant.GraphErrorCount++
Update-AzDataTableRow @TenantsTable -Entity $Tenant
Update-AzDataTableEntity @TenantsTable -Entity $Tenant
}
throw $Message
}
} until ($null -eq $NextURL)
$Tenant.LastGraphError = ''
Update-AzDataTableRow @TenantsTable -Entity $Tenant
Update-AzDataTableEntity @TenantsTable -Entity $Tenant
return $ReturnedData
}
else {
Expand Down Expand Up @@ -222,7 +222,7 @@ function convert-skuname($skuname, $skuID) {
}

function Get-ClassicAPIToken($tenantID, $Resource) {
Write-Host "Using classic"
Write-Host 'Using classic'
$uri = "https://login.microsoftonline.com/$($TenantID)/oauth2/token"
$Body = @{
client_id = $env:ApplicationID
Expand All @@ -241,7 +241,7 @@ function Get-ClassicAPIToken($tenantID, $Resource) {
# Track consecutive Graph API failures
$TenantsTable = Get-CippTable -tablename Tenants
$Filter = "PartitionKey eq 'Tenants' and (defaultDomainName eq '{0}' or customerId eq '{0}')" -f $tenantid
$Tenant = Get-AzDataTableRow @TenantsTable -Filter $Filter
$Tenant = Get-AzDataTableEntity @TenantsTable -Filter $Filter
if (!$Tenant) {
$Tenant = @{
GraphErrorCount = $null
Expand All @@ -253,7 +253,7 @@ function Get-ClassicAPIToken($tenantID, $Resource) {
$Tenant.LastGraphError = $_.Exception.Message
$Tenant.GraphErrorCount++

Update-AzDataTableRow @TenantsTable -Entity $Tenant
Update-AzDataTableEntity @TenantsTable -Entity $Tenant
Throw "Failed to obtain Classic API Token for $TenantID - $_"
}
}
Expand Down Expand Up @@ -370,7 +370,7 @@ function Get-Tenants {
$TenantsTable = Get-CippTable -tablename 'Tenants'
$ExcludedFilter = "PartitionKey eq 'Tenants' and Excluded eq true"

$SkipListCache = Get-AzDataTableRow @TenantsTable -Filter $ExcludedFilter
$SkipListCache = Get-AzDataTableEntity @TenantsTable -Filter $ExcludedFilter

if ($IncludeAll) {
$Filter = "PartitionKey eq 'Tenants'"
Expand All @@ -388,7 +388,7 @@ function Get-Tenants {
$TenantList = (New-GraphGetRequest -uri "https://graph.microsoft.com/beta/tenantRelationships/managedTenants/tenants?`$top=999" -tenantid $env:TenantID ) | Select-Object id, @{l = 'customerId'; e = { $_.tenantId } }, @{l = 'DefaultdomainName'; e = { [string]($_.contract.defaultDomainName) } } , @{l = 'MigratedToNewTenantAPI'; e = { $true } }, DisplayName, domains, tenantStatusInformation | Where-Object -Property defaultDomainName -NotIn $SkipListCache.defaultDomainName, 'Invalid'
}
catch {
Write-Host "probably no license for Lighthouse. Using old API."
Write-Host 'probably no license for Lighthouse. Using old API.'
}
if (!$TenantList) {
$TenantList = (New-GraphGetRequest -uri "https://graph.microsoft.com/beta/contracts?`$top=999" -tenantid $env:TenantID ) | Select-Object id, customerId, DefaultdomainName, DisplayName, domains | Where-Object -Property defaultDomainName -NotIn $SkipListCache.defaultDomainName
Expand Down Expand Up @@ -447,21 +447,21 @@ function Remove-CIPPCache {
# Remove all tenants except excluded
$TenantsTable = Get-CippTable -tablename 'Tenants'
$Filter = "PartitionKey eq 'Tenants' and Excluded eq false"
$ClearIncludedTenants = Get-AzDataTableRow @TenantsTable -Filter $Filter
Remove-AzDataTableRow @TenantsTable -Entity $ClearIncludedTenants
$ClearIncludedTenants = Get-AzDataTableEntity @TenantsTable -Filter $Filter
Remove-AzDataTableEntity @TenantsTable -Entity $ClearIncludedTenants
if ($tenantsonly -eq 'false') {
Write-Host "Clearing all"
Write-Host 'Clearing all'
# Remove Domain Analyser cached results
$DomainsTable = Get-CippTable -tablename 'Domains'
$Filter = "PartitionKey eq 'TenantDomains'"
$ClearDomainAnalyserRows = Get-AzDataTableRow @DomainsTable -Filter $Filter | ForEach-Object {
$ClearDomainAnalyserRows = Get-AzDataTableEntity @DomainsTable -Filter $Filter | ForEach-Object {
$_.DomainAnalyser = ''
$_
}
Update-AzDataTableEntity @DomainsTable -Entity $ClearDomainAnalyserRows
#Clear BPA
$BPATable = Get-CippTable -tablename 'cachebpa'
$ClearBPARows = Get-AzDataTableRow @BPATable
$ClearBPARows = Get-AzDataTableEntity @BPATable
Remove-AzDataTableEntity @BPATable -Entity $ClearBPARows

$Script:SkipListCache = $Null
Expand Down Expand Up @@ -500,7 +500,7 @@ function New-ExoRequest ($tenantid, $cmdlet, $cmdParams, $useSystemMailbox, $Anc
Write-Host "Using $Anchor"
$Headers = @{
Authorization = "Bearer $($token.access_token)"
Prefer = "odata.maxpagesize = 1000"
Prefer = 'odata.maxpagesize = 1000'
'X-AnchorMailbox' = $anchor

}
Expand Down Expand Up @@ -648,8 +648,8 @@ function New-passwordString {
)
Set-Location (Get-Item $PSScriptRoot).FullName
$SettingsTable = Get-CippTable -tablename 'Settings'
$PasswordType = (Get-AzDataTableRow @SettingsTable).passwordType
if ($PasswordType -eq "Correct-Battery-Horse") {
$PasswordType = (Get-AzDataTableEntity @SettingsTable).passwordType
if ($PasswordType -eq 'Correct-Battery-Horse') {
$Words = Get-Content .\words.txt
(Get-Random -InputObject $words -Count 4) -join '-'
}
Expand Down
2 changes: 1 addition & 1 deletion ListApplicationQueue/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -
# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
$Table = Get-CippTable -tablename 'apps'
$QueuedApps = (Get-AzDataTableRow @Table)
$QueuedApps = (Get-AzDataTableEntity @Table)

$CurrentApps = foreach ($QueueFile in $QueuedApps) {
Write-Host $QueueFile
Expand Down
2 changes: 1 addition & 1 deletion ListCAtemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $Templates = Get-ChildItem "Config\*.CATemplate.json" | ForEach-Object {
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'CATemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter) | ForEach-Object {
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$data = $_.JSON | ConvertFrom-Json
$data | Add-Member -NotePropertyName "GUID" -NotePropertyValue $_.GUID
$data
Expand Down
2 changes: 1 addition & 1 deletion ListExConnectorTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $Table = Get-CippTable -tablename 'templates'
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'ExConnectorTemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter) | ForEach-Object {
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$GUID = $_.RowKey
$Direction = $_.direction
$data = $_.JSON | ConvertFrom-Json
Expand Down
2 changes: 1 addition & 1 deletion ListGroupTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Write-Host $Request.query.id
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'GroupTemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter) | ForEach-Object {
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$data = $_.JSON | ConvertFrom-Json
$data
} | Sort-Object -Property displayName
Expand Down
2 changes: 1 addition & 1 deletion ListIntuneTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $Templates = Get-ChildItem "Config\*.IntuneTemplate.json" | ForEach-Object {
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'IntuneTemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter).JSON | ConvertFrom-Json
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json

if ($Request.query.ID) { $Templates = $Templates | Where-Object -Property guid -EQ $Request.query.id }

Expand Down
2 changes: 1 addition & 1 deletion ListSpamFilterTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $Table = Get-CippTable -tablename 'templates'
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'SpamfilterTemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter) | ForEach-Object {
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$GUID = $_.RowKey
$data = $_.JSON | ConvertFrom-Json
$data | Add-Member -NotePropertyName "GUID" -NotePropertyValue $GUID
Expand Down
4 changes: 2 additions & 2 deletions ListStandards/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ $Filter = "PartitionKey eq 'standards'"

try {
if ($Request.query.TenantFilter) {
$tenants = (Get-AzDataTableRow @Table -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction Stop | Where-Object Tenant -EQ $Request.query.tenantFilter
$tenants = (Get-AzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction Stop | Where-Object Tenant -EQ $Request.query.tenantFilter
}
else {
$Tenants = (Get-AzDataTableRow @Table -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction Stop
$Tenants = (Get-AzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json -ErrorAction Stop
}
}
catch {}
Expand Down
2 changes: 1 addition & 1 deletion ListTransportRulesTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $Templates = Get-ChildItem "Config\*.TransportRuleTemplate.json" | ForEach-Objec
#List new policies
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'TransportTemplate'"
$Templates = (Get-AzDataTableRow @Table -Filter $Filter) | ForEach-Object {
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter) | ForEach-Object {
$GUID = $_.RowKey
$data = $_.JSON | ConvertFrom-Json
$data | Add-Member -NotePropertyName "GUID" -NotePropertyValue $GUID
Expand Down
4 changes: 2 additions & 2 deletions RemoveCATemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ try {
$Table = Get-CippTable -tablename 'templates'

$Filter = "PartitionKey eq 'CATemplate' and RowKey eq '$id'"
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed Conditional Access Template with ID $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed Conditional Access Template" }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveExConnectorTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $ID = $request.query.id
try {
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'ExConnectorTemplate' and RowKey eq '$id'"
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed Exchange Connector Template with ID $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed Exchange Connector Template" }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveGroupTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ try {

$Filter = "PartitionKey eq 'GroupTemplate' and RowKey eq '$id'"
Write-Host $Filter
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed Intune Template with ID $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed Template" }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveIntuneTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ try {

$Filter = "PartitionKey eq 'IntuneTemplate' and RowKey eq '$id'"
Write-Host $Filter
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed Intune Template with ID $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed Intune Template" }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveQueuedApp/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $ID = $request.query.id
try {
$Table = Get-CippTable -tablename 'apps'
$Filter = "PartitionKey eq 'apps' and RowKey eq '$id'"
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed application queue for $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed from queue." }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveSpamfilterTemplate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $ID = $request.query.id
try {
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'SpamfilterTemplate' and RowKey eq '$id'"
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed Transport Rule Template with ID $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed Transport Rule Template" }
}
Expand Down
4 changes: 2 additions & 2 deletions RemoveStandard/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $ID = $request.query.id
try {
$Table = Get-CippTable -tablename 'standards'
$Filter = "PartitionKey eq 'standards' and RowKey eq '$id'"
$ClearRow = Get-AzDataTableRow @Table -Filter $Filter
Remove-AzDataTableRow @Table -Entity $clearRow
$ClearRow = Get-AzDataTableEntity @Table -Filter $Filter
Remove-AzDataTableEntity @Table -Entity $clearRow
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed standards for $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed standards deployment" }

Expand Down
Loading

0 comments on commit 517238c

Please sign in to comment.