# Copyright © 2008, Microsoft Corporation. All rights reserved. function RegSnapin([string]$dllName = $(throw "No dll is specified"), [string]$namespace = $(throw "No namespace is specified")) { $dllPath = $dllName Import-Module $dllPath } function UnregSnapin([string]$dllName = $(throw "No dll is specified"), [string]$namespace = $(throw "No namespace is specified")) { $dll = [system.io.path]::getfilename($dllName).TrimEnd(".dll") Remove-Module $dll }