Bylaw

Gallery › Guest Configuration › Azure built-in policies

[Deprecated]: Audit Windows VMs that do not have the specified Windows PowerShell modules installed

Converted Initiative Version 1.0.0-deprecated Deprecated

This initiative deploys the policy requirements and audits Windows virtual machines that do not have the specified Windows PowerShell modules installed. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol

ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.

Azure Policy JSONWindowsPowerShellModules.json · 44 lines
{
  "properties": {
    "displayName": "[Deprecated]: Audit Windows VMs that do not have the specified Windows PowerShell modules installed",
    "policyType": "BuiltIn",
    "description": "This initiative deploys the policy requirements and audits Windows virtual machines that do not have the specified Windows PowerShell modules installed. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol",
    "metadata": {
      "version": "1.0.0-deprecated",
      "category": "Guest Configuration",
      "deprecated": true
    },
    "version": "1.0.0",
    "parameters": {
      "Modules": {
        "type": "string",
        "metadata": {
          "displayName": "PowerShell Modules",
          "description": "A semicolon-separated list of the names of the PowerShell modules that should be installed. You may also specify a specific version of a module that should be installed by including a comma after the module name, followed by the desired version. e.g. PSDscResources; SqlServerDsc, 12.0.0.0; ComputerManagementDsc, 6.1.0.0"
        }
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/90ba2ee7-4ca8-4673-84d1-c851c50d3baf",
        "definitionVersion": "1.*.*",
        "policyDefinitionReferenceId": "Deploy_WindowsPowerShellModules",
        "parameters": {
          "Modules": {
            "value": "[parameters('Modules')]"
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/16f9b37c-4408-4c30-bc17-254958f2e2d6",
        "definitionVersion": "1.*.*",
        "policyDefinitionReferenceId": "Audit_WindowsPowerShellModules"
      }
    ],
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/c980fd64-c67f-49a6-a8a8-e57661150802",
  "name": "c980fd64-c67f-49a6-a8a8-e57661150802"
}
Bylawc980fd64-c67f-49a6-a8a8-e57661150802.bylaw.ps1 · 34 lines
# Converted from WindowsPowerShellModules.json by ConvertTo-Bylaw.
Initiative 'c980fd64-c67f-49a6-a8a8-e57661150802' {

    Properties @{
        DisplayName   = '[Deprecated]: Audit Windows VMs that do not have the specified Windows PowerShell modules installed'
        Description   = 'This initiative deploys the policy requirements and audits Windows virtual machines that do not have the specified Windows PowerShell modules installed. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol'
        Version       = '1.0.0-deprecated'
        Category      = 'Guest Configuration'
        Deprecated    = $true
        PolicyVersion = '1.0.0'
    }

    Parameter Modules @{
        Type        = 'string'
        DisplayName = 'PowerShell Modules'
        Description = 'A semicolon-separated list of the names of the PowerShell modules that should be installed. You may also specify a specific version of a module that should be installed by including a comma after the module name, followed by the desired version. e.g. PSDscResources; SqlServerDsc, 12.0.0.0; ComputerManagementDsc, 6.1.0.0'
        JsonName    = 'Modules'
    }

    PolicyDefinition @{
        Id          = '90ba2ee7-4ca8-4673-84d1-c851c50d3baf'
        ReferenceId = 'Deploy_WindowsPowerShellModules'
        Version     = '1.*.*'
        Parameters  = @{
            Modules = (Param Modules)
        }
    }

    PolicyDefinition @{
        Id          = '16f9b37c-4408-4c30-bc17-254958f2e2d6'
        ReferenceId = 'Audit_WindowsPowerShellModules'
        Version     = '1.*.*'
    }
}

Members (2)

Source: built-in-policies/policySetDefinitions/Guest Configuration/WindowsPowerShellModules.json in Azure/azure-policy, under the MIT licence.