locked
running a script in Start-AppvVirtualProcess RRS feed

  • Question

  • Hi everyone!

    I need to run an a script i made within a couple of packages *to change wich environemt the apps points towards*

    iv tried stuff like:

    Start-AppvVirtualProcess -AppvClientObject $appVName -FilePath Change-server.ps1 -ArgumentList $application,$environment

    and Start-AppvVirtualProcess -AppvClientObject $appVName powershell -argumentlist Change-server.ps1 "$application,$environment"

    but neither actually runs the script inside..

    i have also tried running the script as a function in the main-script as such:

    Start-AppvVirtualProcess -AppvClientObject $appVName powershell Change-server -ArgumentList $application,$environment

    can anyone point me in the right direction to get this to work?

    Wednesday, March 14, 2018 3:41 PM

Answers

  • I actually managed to solve it myself =)

    Start-AppvVirtualProcess -AppvClientObject $appVName -filepath "powershell" -ArgumentList "-command .\change-server.ps1 -app $application -env $environment"


    • Marked as answer by Tony Eklund Thursday, March 15, 2018 9:03 AM
    Thursday, March 15, 2018 9:02 AM

All replies

  • -AppvClientObject needs the appvobject, not the appvname… so try:
    Start-AppvVirtualProcess -AppvClientObject (Get-AppvClientPackage -Name $appvName) -FilePath Change-server.ps1 -ArgumentList $application,$environment
    This seems to be a manual action, which you need to run on all clients, is it not easier to just upgrade the packages?


    Roy Essers

    Thursday, March 15, 2018 12:48 AM
  • Hi! thnx for the answer but maybe i should clarify..

    $appVName is the objcet... the issue im having is launching the script inside the app-v "bubble"..

    doing -filepath *.ps1 just opens the script in notepad :P

    the purpose of this is to be able to change the config on a test machine so that i can test the package against a test-environment before putting it in production..

    Thursday, March 15, 2018 7:53 AM
  • I actually managed to solve it myself =)

    Start-AppvVirtualProcess -AppvClientObject $appVName -filepath "powershell" -ArgumentList "-command .\change-server.ps1 -app $application -env $environment"


    • Marked as answer by Tony Eklund Thursday, March 15, 2018 9:03 AM
    Thursday, March 15, 2018 9:02 AM