ps/Modules/Alkami.PowerShell.Services/Private/VariableDeclarations.ps1
2023-05-30 22:51:22 -07:00

14 lines
564 B
PowerShell

try
{
Add-Type -Path (Get-ChildItem -Path "C:\Windows\assembly\" -Include "Microsoft.Web.Administration.dll" -Recurse).FullName
}
catch
{
try {
# Just in case we have IIS Express and IIS loaded (dev machines)
[System.Reflection.Assembly]::LoadFile("C:\Windows\system32\inetsrv\Microsoft.Web.Administration.dll")
} catch {
# Do nothing in case this is a brand new server
Write-Warning "[Alkami.PowerShell.Services] : Unable to Load Assembly Microsoft.Web.Administration. Some functions may not work as expected."
}
}