Skip to content

Commit

Permalink
Some cleanup and documentation added (dsccommunity#163)
Browse files Browse the repository at this point in the history
* Added documentation

* Cleanup

* Added back reference configuration files

* Cleanup
  • Loading branch information
raandree authored Nov 29, 2023
1 parent b119d6b commit 8b68810
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 48 deletions.
2 changes: 0 additions & 2 deletions .work/Debug.ps1

This file was deleted.

14 changes: 0 additions & 14 deletions .work/GetComplianceState.ps1

This file was deleted.

5 changes: 0 additions & 5 deletions .work/cleanup.ps1

This file was deleted.

20 changes: 20 additions & 0 deletions Lab Guest Configuration/10 Azure Guest Configuration Lab.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<#
.SYNOPSIS
This script creates a lab environment for the Azure Guest Configuration lab.
.PARAMETER LocationName
Specifies the location where the lab environment will be created. Default is 'West Europe'.
.PARAMETER SubscriptionName
Specifies the name of the Azure subscription to use.
.NOTES
This script requires the Azure PowerShell module to be installed.
.EXAMPLE
.\10 Azure Guest Configuration Lab.ps1 -LocationName 'East US' -SubscriptionName 'MySubscription'
This example creates a lab environment in the 'East US' location using the 'MySubscription' Azure subscription.
#>

param
(
[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#Requires -Modules AutomatedLab, Az.Resources, Az.ManagedServiceIdentity

<#
.SYNOPSIS
This script customizes the Azure Guest Configuration lab environment.
.NOTES
This script requires the AutomatedLab, Az.Resources, and Az.ManagedServiceIdentity PowerShell modules to be installed.
.EXAMPLE
.\20 Azure Guest Configuration Lab Customizations.ps1
This example customizes the Azure Guest Configuration lab environment.
#>

if (-not $lab)
{
$lab = Import-Lab -Name GCLab1 -NoValidation -PassThru
Expand Down
26 changes: 26 additions & 0 deletions Lab Guest Configuration/99 Get-MachineComplianceState.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#Get-AzPolicyAssignment -Scope $resourceGroup.ResourceId
$subscriptionId = '<SubscriptionId>'
$resourceGroupName = '<ResourceGroupName>'
$machineName = '<MachineName>'

$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 }
}
12 changes: 0 additions & 12 deletions source/GCPackages/UserAmyNotPresent/UserAmyNotPresent.config.ps1

This file was deleted.

15 changes: 0 additions & 15 deletions source/GCPackages/UserAmyPresent/UserAmyPresent.config.ps1

This file was deleted.

0 comments on commit 8b68810

Please sign in to comment.