Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Get-ServicePrincipalOwner and New-AppRegSecret renamed #10

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions BARK.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1553,8 +1553,8 @@ Function Get-EntraServicePrincipalOwner {

$SPOwners
}
New-Variable -Name 'Get-ServicePrincipalOwnerDefinition' -Value (Get-Command -Name "Get-ServicePrincipalOwner") -Force
New-Variable -Name 'Get-ServicePrincipalOwnerAst' -Value (${Get-ServicePrincipalOwnerDefinition}.ScriptBlock.Ast.Body) -Force
New-Variable -Name 'Get-EntraServicePrincipalOwnerDefinition' -Value (Get-Command -Name "Get-EntraServicePrincipalOwner") -Force
New-Variable -Name 'Get-EntraServicePrincipalOwnerAst' -Value (${Get-EntraServicePrincipalOwnerDefinition}.ScriptBlock.Ast.Body) -Force

Function Get-EntraAppOwner {
<#
Expand Down Expand Up @@ -2095,8 +2095,8 @@ Function New-EntraAppSecret {

$AppRegSecret
}
New-Variable -Name 'New-AppRegSecretDefinition' -Value (Get-Command -Name "New-AppRegSecret") -Force
New-Variable -Name 'New-AppRegSecretAst' -Value (${New-AppRegSecretDefinition}.ScriptBlock.Ast.Body) -Force
New-Variable -Name 'New-EntraAppSecretDefinition' -Value (Get-Command -Name "New-EntraAppSecret") -Force
New-Variable -Name 'New-EntraAppSecretAst' -Value (${New-EntraAppSecretDefinition}.ScriptBlock.Ast.Body) -Force

Function New-EntraServicePrincipalSecret {
<#
Expand Down Expand Up @@ -6342,7 +6342,7 @@ function Invoke-AzureRMAbuseTests {
# https://github.com/PowerShell/PowerShell/issues/16461#issuecomment-967759037
If (-Not ${global:New-TestAppReg}) { $ast = ${using:New-TestAppRegAst}; ${global:New-TestAppReg} = $ast.GetScriptBlock() }
If (-Not ${global:New-TestSP}) { $ast = ${using:New-TestSPAst}; ${global:New-TestSP} = $ast.GetScriptBlock() }
If (-Not ${global:New-AppRegSecret}) { $ast = ${using:New-AppRegSecretAst}; ${global:New-AppRegSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-EntraAppSecret}) { $ast = ${using:New-EntraAppSecretAst}; ${global:New-EntraAppSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-AzureRMRoleAssignment}) { $ast = ${using:New-AzureRMRoleAssignmentAst}; ${global:New-AzureRMRoleAssignment} = $ast.GetScriptBlock() }
If (-Not ${global:Test-AzureRMAddSelfToAzureRMRole}) { $ast = ${using:Test-AzureRMAddSelfToAzureRMRoleAst}; ${global:Test-AzureRMAddSelfToAzureRMRole} = $ast.GetScriptBlock() }
If (-Not ${global:Test-AzureRMVMRunCommand}) { $ast = ${using:Test-AzureRMVMRunCommandAst}; ${global:Test-AzureRMVMRunCommand} = $ast.GetScriptBlock() }
Expand Down Expand Up @@ -6380,7 +6380,7 @@ function Invoke-AzureRMAbuseTests {
Start-Sleep 60s

# Create a secret for the test app reg:
$ThreadSafeSecret = (& ${global:New-AppRegSecret} `
$ThreadSafeSecret = (& ${global:New-EntraAppSecret} `
-AppRegObjectID $ThreadSafeAppReg.AppRegObjectID `
-Token $ThreadSafeGlobalAdminToken.access_token
)
Expand Down Expand Up @@ -8564,7 +8564,7 @@ Function Invoke-AllAzureMGAbuseTests {
# https://github.com/PowerShell/PowerShell/issues/16461#issuecomment-967759037
If (-Not ${global:New-TestAppReg}) { $ast = ${using:New-TestAppRegAst}; ${global:New-TestAppReg} = $ast.GetScriptBlock() }
If (-Not ${global:New-TestSP}) { $ast = ${using:New-TestSPAst}; ${global:New-TestSP} = $ast.GetScriptBlock() }
If (-Not ${global:New-AppRegSecret}) { $ast = ${using:New-AppRegSecretAst}; ${global:New-AppRegSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-EntraAppSecret}) { $ast = ${using:New-EntraAppSecretAst}; ${global:New-EntraAppSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-AppRoleAssignment}) { $ast = ${using:New-AppRoleAssignmentAst}; ${global:New-AppRoleAssignment} = $ast.GetScriptBlock() }
If (-Not ${global:Test-MGAddSelfToEntraRole}) { $ast = ${using:Test-MGAddSelfToEntraRoleAst}; ${global:Test-MGAddSelfToEntraRole} = $ast.GetScriptBlock() }
If (-Not ${global:Test-MGAddSelfToMGAppRole}) { $ast = ${using:Test-MGAddSelfToMGAppRoleAst}; ${global:Test-MGAddSelfToMGAppRole} = $ast.GetScriptBlock() }
Expand Down Expand Up @@ -8603,7 +8603,7 @@ Function Invoke-AllAzureMGAbuseTests {
Start-Sleep 60s

# Create a secret for the test app reg:
$ThreadSafeSecret = (& ${global:New-AppRegSecret} `
$ThreadSafeSecret = (& ${global:New-EntraAppSecret} `
-AppRegObjectID $ThreadSafeAppReg.AppRegObjectID `
-Token $ThreadSafeGlobalAdminToken.access_token
)
Expand Down Expand Up @@ -8891,7 +8891,7 @@ Function Invoke-AllEntraAbuseTests {
# https://github.com/PowerShell/PowerShell/issues/16461#issuecomment-967759037
If (-Not ${global:New-TestAppReg}) { $ast = ${using:New-TestAppRegAst}; ${global:New-TestAppReg} = $ast.GetScriptBlock() }
If (-Not ${global:New-TestSP}) { $ast = ${using:New-TestSPAst}; ${global:New-TestSP} = $ast.GetScriptBlock() }
If (-Not ${global:New-AppRegSecret}) { $ast = ${using:New-AppRegSecretAst}; ${global:New-AppRegSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-EntraAppSecret}) { $ast = ${using:New-EntraAppSecretAst}; ${global:New-EntraAppSecret} = $ast.GetScriptBlock() }
If (-Not ${global:New-AppRoleAssignment}) { $ast = ${using:New-AppRoleAssignmentAst}; ${global:New-AppRoleAssignment} = $ast.GetScriptBlock() }
If (-Not ${global:Test-MGAddSelfToEntraRole}) { $ast = ${using:Test-MGAddSelfToEntraRoleAst}; ${global:Test-MGAddSelfToEntraRole} = $ast.GetScriptBlock() }
If (-Not ${global:Test-MGAddSelfToMGAppRole}) { $ast = ${using:Test-MGAddSelfToMGAppRoleAst}; ${global:Test-MGAddSelfToMGAppRole} = $ast.GetScriptBlock() }
Expand Down Expand Up @@ -8929,7 +8929,7 @@ Function Invoke-AllEntraAbuseTests {
Start-Sleep 60s

# Create a secret for the test app reg:
$ThreadSafeSecret = (& ${global:New-AppRegSecret} `
$ThreadSafeSecret = (& ${global:New-EntraAppSecret} `
-AppRegObjectID $ThreadSafeAppReg.AppRegObjectID `
-Token $ThreadSafeGlobalAdminToken.access_token
)
Expand Down
Loading