Error running 'deploy.ps1'

greg.burgess's Avatar

greg.burgess

05 Nov, 2015 11:51 PM

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. Support Staff 1 Posted by Feodor Fitsner on 06 Nov, 2015 12:30 AM

    Feodor Fitsner's Avatar

    What operating system is that?

  2. 2 Posted by greg.burgess on 06 Nov, 2015 12:34 AM

    greg.burgess's Avatar

    Hi Feodor,

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

    Thanks for the quick reply!

    Regards,
    Greg

  3. 3 Posted by greg.burgess on 06 Nov, 2015 12:37 AM

    greg.burgess's Avatar

    This is the current output from the deployment console.

  4. Support Staff 4 Posted by Feodor Fitsner on 06 Nov, 2015 12:44 AM

    Feodor Fitsner's Avatar

    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. 5 Posted by greg.burgess on 06 Nov, 2015 12:46 AM

    greg.burgess's Avatar

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

    Regards,
    Greg

  6. Support Staff 6 Posted by Feodor Fitsner on 06 Nov, 2015 12:53 AM

    Feodor Fitsner's Avatar

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

  7. 7 Posted by greg.burgess on 06 Nov, 2015 01:58 AM

    greg.burgess's Avatar

    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