ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Solved Chocolatey not available after being installed through ScreenConnect

    IT Discussion
    connectwise control chocolatey path environment monitoring
    4
    6
    3.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JasGot
      last edited by JasGot

      I installed Chocolatey via powershell in a CMD push from ScreenConnect. Install ended with no errors.

      But when trying to run Choco via CMD or PS withing SC, I get this error:

      choco : The term 'choco' 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:\Windows\TEMP\ScreenConnect\19.2.24707.7131\f5d4735e-308a-408b-ab46-1e7e110970c8run.ps1:1 char:1
      + choco install putty.install
      + ~~~~~
          + CategoryInfo          : ObjectNotFound: (choco:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      

      However, when running from a CMD or PS at the client console, all is fine.

      The installer warns that restarting the cmd or powershell may be needed before choco will work, but how would you do this via SC cmd when the SC cmds are run as system?

      1 Reply Last reply Reply Quote 0
      • JaredBuschJ
        JaredBusch
        last edited by JaredBusch

        I have never had it be accessible to screen connect until a reboot. But I rarely install it this way, so memory is fuzzy.

        I guess you could cycle the screenconnect client service. That should do the same.

        J 1 Reply Last reply Reply Quote 1
        • black3dynamiteB
          black3dynamite
          last edited by

          When you run this, $env:ChocolateyInstall, does it show C:\ProgramData\chocolatey
          Also try refreshenv command to see that helps.

          J 1 Reply Last reply Reply Quote 0
          • J
            JasGot @black3dynamite
            last edited by

            @black3dynamite said in Chocolatey not available after being installed through ScreenConnect:

            refreshenv

            $env:ChocolateyInstall is null; which is to be expected because the env hasn't yet been re-read.

            refreshenv doesn't work because that is a command that choco installed to the env path that hasn't been refreshed yet. Both commands will work great after the env is refreshed. The question is how to refresh the env before I can run the command to refresh the env?

            1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch
              last edited by JaredBusch

              I have never had it be accessible to screen connect until a reboot. But I rarely install it this way, so memory is fuzzy.

              I guess you could cycle the screenconnect client service. That should do the same.

              J 1 Reply Last reply Reply Quote 1
              • scottalanmillerS
                scottalanmiller
                last edited by

                I find it sometimes available, and sometimes not. But the situation here is definitely just the env not being picked up yet.

                1 Reply Last reply Reply Quote 0
                • J
                  JasGot @JaredBusch
                  last edited by

                  @JaredBusch said in Chocolatey not available after being installed through ScreenConnect:

                  I guess you could cycle the screenconnect client service. That should do the same.

                  This did it; thanks. It's the only working solution short of a reboot. I did not want to connect to the client with SC so I pushed a re-install, it was current, so it just went through the motions and restarted the services. Perfect for my needs.

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post