[2.9.0] Trying to transfer module location

Hi all,

I am trying to transfer the module location as stated in the new IIS setup in the site. I am getting the error below:

Location of the module: “C:\Powershell Modules\2.9.0”

Application ‘MACHINE/WEBROOT/APPHOST/TEST’ with physical root ‘C:\inetpub\wwwroot\TEST2’ failed to start process with commandline ‘C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe .\dashboard.ps1’, ErrorCode = '0x80004005 : 0.

my web config:

<?xml version="1.0" encoding="utf-8"?>

my dashboard:
$env:PSModulePath = “C:\Powershell Modules\2.9.0”
Start-UDDashboard -Wait -Dashboard (
New-UDDashboard -Title “Hello, IIS” -Content {
New-UDCard -Title “Hello, IIS”
}
)

Thanks!

It works if I put the modules in: “C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard.Community”. But I want to try this method for easy update of modules:

I have been tinkering with this today and installed fresh servers because i was getting an error while upgrading. Installation of 2.9 (ent) does not include UniversalDashboardServer.exe, or UniversalDashboardServer.Config…
2.9.0:


2.8.3:

@adam

Any thoughts on how to upgrade in-place without spinning up a new server? I’m coming from 2.5.2 and upgrading to 2.9.0. I have multiple dashboards on a single server with some custom configuration that I’d rather not rebuild.

Hello @secdav3 and welcome to the UD forums. You can download multiple versions of UD and each version will then be placed in it’s own folder…I mean I run my dashboards in IIS so I would stop the site, copy the module files back into my IIS folder and start the site again…when I script my dashboards I always use the module copied into the IIS folder.
So in theory no need to spin any new servers either copy over the current module files in the IIS folder like me…or in your script on the import-module use -RequiredVersion parameter…Also just for saftey as I do not want you cursing me…create a folder called “old” or “backup” backup the current module files, so if you do get any unforseen bugs/features after upgrading you can just overwrite with the old/backup files. :crazy_face:

@secdav3
I would like to add one more thing that is important regarding V 2.9.0 which is the web.config file has been updated so now its using existing powershell version to run UD.
UD operate as a self contained App so whenever you want to upgrade you have to delete all previews version contents and replace it with new version files with paying attention to web.config data.

1 Like

Thanks for your quick feedback! When I copied over the new module files I stopped the IIS site, deleted everything except for my dashboard.ps1 file, and then pasted in the new module files. I confirmed that the web.config file is the stock config that comes with the 2.9.0 module which includes PowerShell.exe instead of the old exe in previous versions. However, when I run the site I keep getting the same error as the OP.

I see this error in my Application logs: Application ‘MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE’ with physical root ‘C:\inetpub\wwwroot’ failed to start process with commandline 'PowerShell.exe ', ErrorCode = '0x80004005 : 2.

In my Sysmon logs I see a Process Create for “wermgr.exe” Windows Problem Reporting the second after I start the IIS site

And my verbose PowerShell\Operational logs show “PowerShell console is ready for user input” immediately followed by "Creating Scriptblock text (1 of 1):
prompt

ScriptBlock ID: 3005d057-4817-49bf-b859-472a95303062
Path: "
and then a second later I see it starting up another PowerShell console, likely because of whatever happened that caused the Windows Problem Reporting to kick off.

I’m not sure if this is relevant, but I see a “File create” event in my Sysmon logs just before the Windows Problem Reporting kicks off: “File created:
RuleName:
UtcTime: 2020-04-15 13:58:42.562
ProcessGuid:
ProcessId: 10876
Image: C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe
TargetFilename: C:\Windows\Temp__PSScriptPolicyTest_ixqseyxv.dcm.ps1
CreationUtcTime: 2020-04-15 13:58:42.562”

I confirmed that the account the IIS site is running as can see the 2.9.0 version when I run Get-InstalledModule as that account (I added a custom module path for UD as referenced in the UD-IIS documentation). I also have the very beginning of my dashboard.ps1 file configured to write Debug level of UDLogging but I never get any logs, presumably because whatever is failing is happening before it can get that far.

Can you think of any ways I could get more detailed logs of what’s occurring? Or do you have any thoughts on other things I could try?

Thanks in advance for any time and assistance.

This is what you need to do to troubleshoot your issue.
1- re install asp.net core hosting bundle.(uninstall and reinstall)
2-find small test dashboard example, do not use your own at this point and just test with a simple dashboard.
3- use the simple dashboard first to test locally without IIS. This test will make sure that UD is working properly and that all prerequisites are installed correctly
4- if the test works with no issues then your focus will shift to IIS only, make sure the apppool account has enough rights on the UD folder
5- run the following command to unblock all the files in the UD folder
gci -path “path of your UD folder” - recurse | unblock-file
6-now test the simple dashboard with IIS
If everything works then test your own dashboard if there is an issue then it’s your dashboard file and u need to check your code.

1 Like

Thank you all for your help. I uninstalled the dotnet hosting bundle (which I found to be an older version than what is now referenced in the documentation) and installed the new one. I was still getting the same error at that point.

As I was copying out the demo IIS dashboard script from the documentation I noticed that the default web.config file that comes with the module does not match what the documentation says it should be. I also found that the new version of the documentation doesn’t mention copying all the module files into the wwwroot folder, as the older version needed.

After modifying the web.config file to match the documentation and deleting everything from wwwroot except for the dashboard.ps1 file and the web.config file everything started working.

Thanks again!

2 Likes