ps vs pwsh - Push-AppveyorArtifact

Push-AppveyorArtifact's Avatar

Push-AppveyorArtifact

18 Nov, 2024 06:28 PM

Quick question
Is the Push-AppveyorArtifact module supported by both ps and pwsh? Or is there an alternative?

When attempting to rum my script vi pwsh, i'm getting the following error:

Push-AppveyorArtifact had an error: Could not load type 'System.Web.SecurityUtils' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
ScriptStackTrace: at Push-AppveyorArtifact, C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1: line 209
at GenerateNuGetPackages, C:\projects\web-timesheet\build-scripts\functions.ps1: line 120
at , : line 10
Exception: System.TypeLoadException: Could not load type 'System.Web.SecurityUtils' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) at Appveyor.BuildAgent.Api.JsonUtility.ToJson(Object data) at Appveyor.BuildAgent.Api.JsonUtility.ToJsonBytes(Object data) at Appveyor.BuildAgent.Api.RestBuildServices.AddArtifact(String path, String fileName, String name, Nullable1 type) at Appveyor.BuildAgent.Api.Utils.UploadDownloadUtility.UploadArtifact(String path, String fileName, String name, Nullable1 type, UploadVerbosity verbosity, Action`1 write) at Appveyor.BuildAgent.Api.Utils.PushAppveyorArtifactInternalCmdlet.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() Retrying Push-AppveyorArtifact...

  1. Support Staff 1 Posted by Owen McDonnell on 19 Nov, 2024 10:20 PM

    Owen McDonnell's Avatar

    I don't believe those cmdlets will work with core (pwsh). Alternatives are cmd or the rest api.

  2. 2 Posted by Push-AppveyorAr... on 20 Nov, 2024 02:15 PM

    Push-AppveyorArtifact's Avatar

    Thanks Owen. Based on the stack trace I was pretty sure that was going to be the response, but I wanted to rule out that I wasn't doing something silly.

    Perhaps an update to the documents saying supported only in Windows Powershell 5.1 would be in order (https://www.appveyor.com/docs/build-worker-api/#powershell-5)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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