Release Automation

Expand all | Collapse all

"PowerShell - Run Script File" action doesn't execute script?

Jump to Best Answer
  • 1.  "PowerShell - Run Script File" action doesn't execute script?

    Posted 01-29-2016 01:26 AM

    Hi there,

     

    I'm currently feeling a bit stupid, as it seems so much of a simple task, so I probably missing something small:

     

    it is the first time we need to run a powershell script file with release automation, before we always could use the execute script block action.

     

    I'm trying to run a very simple script file with the following content:

    Import-Module WebAdministration
    
    
    New-WebAppPool GuardLiteAppPool
    New-WebSite -Name GuardLite -PhysicalPath "C:\Data\WWW\GuardLite" -ApplicationPool GuardLiteAppPool
    
    
    Set-ItemProperty IIS:\AppPools\GuardLiteAppPool -name startMode -value AlwaysRunning
    Set-ItemProperty IIS:\AppPools\GuardLiteAppPool -name autoStart -value true
    Set-ItemProperty IIS:\AppPools\GuardLiteAppPool -Name processModel.idleTimeoutAction -value Suspend
    Set-ItemProperty IIS:\AppPools\GuardLiteAppPool -name recycling.logEventOnRecycle -value "Time, Memory, OnDemand, ConfigChange, PrivateMemory"
    Set-ItemProperty IIS:\AppPools\GuardLiteAppPool -Name recycling.periodicRestart.privateMemory -value 2097152
    Set-ItemProperty IIS:\Sites\GuardLite -name serverAutoStart -value true
    Set-ItemProperty IIS:\Sites\GuardLite -name bindings -value @{protocol="http";bindingInformation="*:8087:"}
    Set-ItemProperty IIS:\Sites\GuardLite -name logFile.directory -value C:\Data\Logs\GuardLite\IIS
    Set-ItemProperty IIS:\Sites\GuardLite -name logFile.localTimeRollover -value true
    
    
    Start-WebAppPool -Name GuardLiteAppPool
    Start-WebSite -Name GuardLite
    
    

     

    When I'm starting it from the powershell cmd on the server itself, the script runs and does everything it is supposed to do. But when I'm using the run script file action in CARA nothing happens (I'm just testing the action, no deployment involved).

     

    for the script file path I'm setting "C:\Install\GuardLitePoC\CreateWeb.ps1" and for the Working Directory I've tried "." , ".\", "C:\Install\GuardLitePoC\", "C:\Install\GuardLitePoC", none of these set ups works

     

    Regarding the Wiki there might be some configuration to do on the agents: Microsoft PowerShell - CA Release Automation - 5.5.2 - CA Technologies Documentation

    Is this always necessary? because we've never done this and were able to use the run script block action and also powershell itself is working on the server

     

    So yeah, any help would be much appreciated.

     

    Thanks.

    michael



  • 2.  Re: "PowerShell - Run Script File" action doesn't execute script?
    Best Answer

    Posted 01-29-2016 03:12 AM

    apperently I missed to set the 64bit flag to true, after that it worked.