summary import { KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function purgeAManagedHsmPool ( ) { const subscriptionId = "00000000-0000-0000-0000-000000000000" ; const name = "hsm1" ; const location = "westus" ; const credential = new DefaultAzureCredential ( ) ; const client = new KeyVaultManagementClient ( credential , subscriptionId ) ; const result = await client . managedHsms . beginPurgeDeletedAndWait ( name , location ) ; console . log ( result ) ; } purgeAManagedHsmPool ( ) . catch ( console . error ) ;