Release Automation

 View Only
  • 1.  Need assistance with RDK construct using import module webadministration

    Posted Sep 16, 2016 01:57 PM

    Question: Need assistance with RDK construct using import module webadministration

     

    I have a powershell script that runs successfully as a standalone script. I am trying to use RDK to create an action and getting errors. I suspect that the import module is failing based on the error that I receive.

    Note also that the reason I require using webadministration module is because I want to continue to build actions – one of which is to retrieve the app pool name from the site name… so that we can recycle the app pool.

     

    Here is my script:

     

    $sitename = ${SiteName}

    #$sitename = "authenticationservice"

     

    import-module webadministration

    set-location "iis:\sites"

     

       try

        {

     

     

    start-webitem $siteName 

        }

       catch

        

        {

       #$global:test = $_

       Write-Warning ($_.exception.message)

       

        }

     

     

     

     

    After importing into RA and running…

    Below is the message. Note that iis:\sites is only exposed from the webadministration module… which is why I am thinking that is where the issue lies…that the module import is not successful

     

     

    Inputs:

    SiteName

    authenticationservice

    Outputs:

    Execution Output

    null

    Error Output

    authenticationservice : The term 'authenticationservice' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Users\nolioservice\AppData\Local\Temp\tempCommand_5902796750199227731.ps1:3 char:14 + $sitename = authenticationservice + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (authenticationservice:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException set-location : Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). At C:\Users\nolioservice\AppData\Local\Temp\tempCommand_5902796750199227731.ps1:7 char:1 + set-location "iis:\sites" + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Set-Location], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.PowerShell.Commands.SetLocationCommand start-webitem : Command start is not applicable to the item on path IIS:\. At C:\Users\nolioservice\AppData\Local\Temp\tempCommand_5902796750199227731.ps1:13 char:1 + start-webitem $siteName + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.String[]:String[]) [Start-WebItem], ArgumentException + FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartItemCommand

    Exit Code

    0

    Return Code

    0

     

     

    For comparison, on my test server if I attempt to run this without the import module: here are my results:

     

    start-webitem : Command start is not applicable to the item on path IIS:\.

    At C:\Users\lewister\Documents\scripts\test_start_site wo module 16sep.ps1:13 char:1

    + start-webitem $siteName

    + ~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo         : InvalidOperation: (System.String[]:String[]) [Start-WebItem], ArgumentException

       + FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartItemCommand



  • 2.  Re: Need assistance with RDK construct using import module webadministration

    Posted Sep 17, 2016 03:20 AM

    didn't work with the RDK yet, so I can't help there. I'm more interested to know, why you're using a powershell script to start a website instead of maybe a command line call to appcmd.

     

    but yeah, I'm getting the other thing, that you require it maybe for other actions



  • 3.  Re: Need assistance with RDK construct using import module webadministration

    Posted Sep 19, 2016 10:50 AM

    When I tried to use a cmdlet into a script I got an error very similar did you got.

    I solved loadin requested module first. Tha's why I did as bellow:

     

    Add-PSSnapIn Citrix.XenApp.Commands (<--Module needed) ; Set-XAApplication...... (Cmdlet did I used).



  • 4.  Re: Need assistance with RDK construct using import module webadministration

    Broadcom Employee
    Posted Sep 29, 2016 02:55 AM

    Hi

    Did the answer from Eduardo answered your question? If it did please mark it as the right answer. When your question is not answered or you still have additional questions please let us know.

    With Kind Regards



  • 5.  Re: Need assistance with RDK construct using import module webadministration
    Best Answer

    Posted Sep 29, 2016 09:54 AM

    We believe this problem is related to a possible defect in the Java wrapper of the RDK involving setting the input parameter as the value of a Powershell variable. This is being reviewed by Engineering.