14 lines
564 B
PowerShell
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."
|
|
}
|
|
} |