text: /*
   * Copyright (c) Microsoft Corporation.
   * Licensed under the MIT License.
   *
   * Code generated by Microsoft (R) AutoRest Code Generator.
   * Changes may cause incorrect behavior and will be lost if the code is regenerated.
   */
  
  // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  const { PolicyClient } = require("@azure/arm-policy");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to This operation retrieves the policy definition in the given management group with the given name.
   *
   * @summary This operation retrieves the policy definition in the given management group with the given name.
   * x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/examples/getPolicyDefinitionAtManagementGroup.json
   */
  async function retrieveAPolicyDefinitionAtManagementGroupLevel() {
    const subscriptionId = "00000000-0000-0000-0000-000000000000";
    const policyDefinitionName = "ResourceNaming";
    const managementGroupId = "MyManagementGroup";
    const credential = new DefaultAzureCredential();
    const client = new PolicyClient(credential, subscriptionId);
    const result = await client.policyDefinitions.getAtManagementGroup(
      policyDefinitionName,
      managementGroupId
    );
    console.log(result);
  }
  
  retrieveAPolicyDefinitionAtManagementGroupLevel().catch(console.error);
  