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

    Chocolatey Installation Process Logging

    IT Discussion
    4
    16
    1.2k
    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.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Doesn't work on Windows 7, no Invoke-Expression 😞

      black3dynamiteB 1 Reply Last reply Reply Quote 0
      • black3dynamiteB
        black3dynamite @scottalanmiller
        last edited by black3dynamite

        @scottalanmiller said in Chocolatey Installation Process Logging:

        Doesn't work on Windows 7, no Invoke-Expression 😞

        You will have install the latest Windows Management Framework.
        https://docs.microsoft.com/en-us/powershell/wmf/readme

        1 Reply Last reply Reply Quote 1
        • ObsolesceO
          Obsolesce
          last edited by Obsolesce

          @scottalanmiller said in Chocolatey Installation Process Logging:

          Doesn't work on Windows 7, no Invoke-Expression 😞

          Specifically Windows 7 limitation, or it doesn't work on certain versions of PowerShell?

          We have a bunch of Windows 7 machines running PS 5.1.

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • ObsolesceO
            Obsolesce
            last edited by

            Verified that Chocolatey has in fact installed on Windows 7 using that PowerShell script (using Invoke-Expression).

            So it's something else stopping the install.

            On one particular Win7 machine, it is running PowerShell 5.1 (which that itself requires the updated WMF).

            So back to the question, how do I get the output of the Chocolatey install to append to a log file?

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

              @tim_g Chocolatey normally logs itself. Is something wrong with that log?

              ObsolesceO 1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @Obsolesce
                last edited by

                @tim_g said in Chocolatey Installation Process Logging:

                @scottalanmiller said in Chocolatey Installation Process Logging:

                Doesn't work on Windows 7, no Invoke-Expression 😞

                Specifically Windows 7 limitation, or it doesn't work on certain versions of PowerShell?

                We have a bunch of Windows 7 machines running PS 5.1.

                The version of PS on Windows 7 by default lacks that command.

                ObsolesceO 1 Reply Last reply Reply Quote 0
                • ObsolesceO
                  Obsolesce @scottalanmiller
                  last edited by

                  @scottalanmiller said in Chocolatey Installation Process Logging:

                  @tim_g said in Chocolatey Installation Process Logging:

                  @scottalanmiller said in Chocolatey Installation Process Logging:

                  Doesn't work on Windows 7, no Invoke-Expression 😞

                  Specifically Windows 7 limitation, or it doesn't work on certain versions of PowerShell?

                  We have a bunch of Windows 7 machines running PS 5.1.

                  The version of PS on Windows 7 by default lacks that command.

                  Yes a lot of great stuff is lacking in old PS versions. That's why it's good to keep systems up to date with things like PowerShell. It helps with so much.

                  1 Reply Last reply Reply Quote 2
                  • ObsolesceO
                    Obsolesce @JaredBusch
                    last edited by

                    @jaredbusch said in Chocolatey Installation Process Logging:

                    @tim_g Chocolatey normally logs itself. Is something wrong with that log?

                    It's not getting that far. No c:\programdata\chocolatey which is where the log would be.

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

                      @tim_g said in Chocolatey Installation Process Logging:

                      @jaredbusch said in Chocolatey Installation Process Logging:

                      @tim_g Chocolatey normally logs itself. Is something wrong with that log?

                      It's not getting that far. No c:\programdata\chocolatey which is where the log would be.

                      Why are you using your own made up command to run the install?

                      Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

                      ObsolesceO 1 Reply Last reply Reply Quote 0
                      • ObsolesceO
                        Obsolesce @JaredBusch
                        last edited by Obsolesce

                        @jaredbusch said in Chocolatey Installation Process Logging:

                        iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

                        iex is an alias to Invoke-Expression

                        @jaredbusch said in Chocolatey Installation Process Logging:

                        Set-ExecutionPolicy Bypass -Scope Process -Force;

                        I don't need this part, because it's running as a computer startup script via Group Policy.

                        @jaredbusch said in Chocolatey Installation Process Logging:

                        Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

                        So, it's the same thing... nothing made up, you just give me the exact same thing I'm already doing.

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

                          Wait.. I thought Invoke-Expression has existed for a long time..

                          It is Invoke-WebRequest that was in Powershell3+

                          1 Reply Last reply Reply Quote 0
                          • ObsolesceO
                            Obsolesce
                            last edited by

                            Does the Chocolatey installer grab anything from anywhere other than *.chocolatey.org?

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

                              @tim_g said in Chocolatey Installation Process Logging:

                              Does the Chocolatey installer grab anything from anywhere other than *.chocolatey.org?

                              No. You can look in the script to see that.

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

                                [jbusch@dt-jared ~]$ grep http install.ps1 
                                # at https://github.com/chocolatey/chocolatey.org
                                #   http://www.apache.org/licenses/LICENSE-2.0
                                  $url = "https://chocolatey.org/api/v2/package/chocolatey/$chocolateyVersion"
                                      # http://www.leeholmes.com/blog/2008/07/30/workaround-the-os-handles-position-is-not-what-filestream-expected/ plus comments
                                  Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to do one or more of the following: (1) upgrade to .NET Framework 4.5+ and PowerShell v3, (2) specify internal Chocolatey package location (set $env:chocolateyDownloadUrl prior to install or host the package internally), (3) use the Download + PowerShell method of install. See https://chocolatey.org/install for all install options.'
                                  $url = 'https://chocolatey.org/api/v2/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion'
                                  Download-File 'https://chocolatey.org/7za.exe' "$7zaExe"
                                [jbusch@dt-jared ~]$ 
                                
                                1 Reply Last reply Reply Quote 0
                                • ObsolesceO
                                  Obsolesce
                                  last edited by

                                  Well I figured out the issue preventing the install of Chocolatey.

                                  It was because these specific machines are on an off-internet network, and were also NOT connecting through a proxy server.

                                  After applying a .reg file to set the computer to use the proxy server, Chocolatey installed, and therefore salt-minion installed, too, (after whitelisting .saltstack.com on the proxy servers). I entered a pssession on the machine and seen that Chocolatey installs salt-minion from the saltstack.com repo. All is well now, so long as off-internet computers are using a proxy server.

                                  Script log file:

                                  2018-03-23 11:18:52 Checking for Salt Minion process.
                                  2018-03-23 11:18:52 Salt Minion is NOT running. Attempting to start.
                                  2018-03-23 11:18:52 Salt Minion executable is missing. Can't start.
                                  2018-03-23 11:18:52 Salt Minion is still NOT running. Attempting to reinstall Salt Minion and Chocolatey.
                                  2018-03-23 11:18:52 Checking for Salt Minion process after reinstall attempt.
                                  2018-03-23 11:18:52 Salt Minion is still NOT running. Reinstall FAILED.
                                  2018-03-23 11:18:52 Email sent to ****@****.com - Salt Minion reinstall FAILED on ****03
                                  2018-03-23 11:18:52 Checking if Chocolatey is functional.
                                  2018-03-23 11:18:52 Chocolatey is functional.
                                  2018-03-23 11:23:50 Checking for Salt Minion process.
                                  2018-03-23 11:23:50 Salt Minion is NOT running. Attempting to start.
                                  2018-03-23 11:23:50 Salt Minion executable is missing. Can't start.
                                  2018-03-23 11:23:50 Salt Minion is still NOT running. Attempting to reinstall Salt Minion and Chocolatey.
                                  2018-03-23 11:23:50 Checking for Salt Minion process after reinstall attempt.
                                  2018-03-23 11:23:50 Salt Minion is running. Reinstall successful.
                                  2018-03-23 11:23:50 Email sent to ****@****.com - Salt Minion reinstall successful on ****03
                                  2018-03-23 11:23:50 Checking if Chocolatey is functional.
                                  2018-03-23 11:23:50 Chocolatey is functional.
                                  

                                  However, I still would like to know how to have the Chocolatey installer append it's install status to a log file from my script.

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