Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
raandree committed Jun 16, 2023
1 parent cdf884d commit e137782
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 216 deletions.
131 changes: 0 additions & 131 deletions .build/gcTasks.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions .work/Debug.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$env:azureClientSecret = 'ygR8Q~Uyy0QkiefumgWPd6NoNbyGwHCh4r6bFdf0'
$env:azureClientId = 'a0732820-7169-4ac5-bf37-755386f5e224'
$env:azureClientSecret = '<secret>'
$env:azureClientId = '<appClientId>'
63 changes: 0 additions & 63 deletions .work/GcTest1.ps1

This file was deleted.

14 changes: 14 additions & 0 deletions .work/GetComplianceState.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Get-AzPolicyAssignment -Scope $resourceGroup.ResourceId
$subscriptionId = 'da78bd51-11ab-418d-8222-db661c2aa8d9'
$resourceGroupName = 'GCLab1'
$machineName = 'DSCFile03'

$uri = "https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Compute/virtualMachines/$machineName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments?api-version=2022-01-25"

Invoke-AzRestMethod -Method GET -Uri $uri | Select-Object -ExpandProperty content | ConvertFrom-Json |
Select-Object -ExpandProperty value |
Format-Table Name,
@{ Name = 'AssignmentType'; Expression = { $PSItem.properties.guestConfiguration.assignmentType } },
@{ Name = 'LastComplianceStatusChecked'; Expression = { $PSItem.properties.lastComplianceStatusChecked } },
@{ Name = 'ComplianceStatus'; Expression = { $PSItem.properties.complianceStatus } },
@{ Name = 'Version'; Expression = { $PSItem.properties.guestConfiguration.version } }
14 changes: 0 additions & 14 deletions .work/temp.ps1

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ Write-Host "Assigning role 'Contributor' to user assigned identity '$($managedId
New-AzRoleAssignment -ObjectId $managedIdentity.Id -RoleDefinitionName Contributor -Scope $lab.AzureSettings.DefaultResourceGroup.ResourceId
Write-Host "Assigning role 'Guest Configuration Resource Contributor' to user assigned identity '$($managedIdentity.DisplayName)'"
New-AzRoleAssignment -ObjectId $managedIdentity.Id -RoleDefinitionName 'Guest Configuration Resource Contributor' -Scope $lab.AzureSettings.DefaultResourceGroup.ResourceId

#DevOps Organization and Service Connection must be created prior to running these lines
$azureDevOpsOrganizationName = 'randree'
$azureDevOpsProjectName = 'DscWorkshop'
$serviceConnectionServicePrincipal = Get-AzADServicePrincipal | Where-Object DisplayName -like "$azureDevOpsOrganizationName-$azureDevOpsProjectName*"
New-AzRoleAssignment -ObjectId $serviceConnectionServicePrincipal.Id -RoleDefinitionName 'Resource Policy Contributor'

0 comments on commit e137782

Please sign in to comment.