Error running 'deploy.ps1'

Hi,

I am new to AppVeyor, but have some experience with different automation tools. Just wondering if anyone else has had this same issue.

I am deploying zipped artifacts to a web server, and that is working correctly.

I then need to run a script to perform an installation, and this is where the problem comes in. I have added a file called 'deploy.ps1' in the root of the zipped artifact. This is being copied to the server correctly but when an attempt is made to run this script as a part of the deployment, the following error is thrown.

Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

The webserver is running the following powershell version:
Name Value
---- -----
CLRVersion 2.0.50727.5485
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

not sure exactly what else to include, but any help would be appreciated.

when i run the script manually on the web server it runs correctly. (i have changed the script to just create a directory and still get the same error)

Thanks

  1. What operating system is that?

  2. Hi Feodor,

    We are running Windows Server 2008 R2 standard, 64 bit.

    Thanks for the quick reply!

    Regards,
    Greg

  3. This is the current output from the deployment console.

  4. OK, I see. You should install WMF 4.0 (PowerShell 4.0) on that machine to make it work: https://www.microsoft.com/en-us/download/details.aspx?id=40855

  5. Again thanks for such a quick response. I'll give it a go.

    Regards,
    Greg

  6. You're welcome. Let me know about the results.

  7. Scripts are now running. Thanks a lot for your time.

    Regards,
    Greg

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:01 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions