4 Replies Latest reply on Dec 24, 2018 4:07 AM by phoffmann

    powershell scripts runs but does not install .vsto package

    James_222 Rookie

      I have created a PowerShell package to install an Outlook Plug-in. The script runs and is reported as a success but installing the .VSTO package does not occur. We install a certificate and download all the required files to the local PC but the plugin is not installed. If I run the PS script directly on the PC the entire operation runs and the plugin is installed. Is there something I need to do to allow the .VSTO file to run?

        • 1. Re: powershell scripts runs but does not install .vsto package
          phoffmann SupportEmployee

          Are there any debugging logs you can enable for the VSTO process ...?

           

          Usually "User context" can make a key point here -- in that we're usually running things as "local system" ... and this may be an instance where you need to run it as "an actual admin" (so you can try running the package as a domain admin for a test, for instance).

           

          That and/or throw in logging into your Powershell script of your own, may help you figure out what's going on.

           

          To help along, here's a simple Logging function I've created years ago & have been using in POSH in my scripts ...

           

          $LogFilePath = "C:\MyLog.txt" # Point to some location & give a file name in the path
          ######################################################
          ### LOGGER FUNCTION ###
          # Simple logger function to keep track of things & write desired strings into out log.
          # Will create an empty line (for white space) if the string handed to it is empty.
          ######################################################
          function Logger ([string]$LogString) {
              if ($LogString -eq "") {
                  Out-File -FilePath $LogFilePath -inputobject "" -Append
                  Write-Host ("")
              }
              else {
                  [string]$FullLineString = (Get-Date -Format r).ToString() + " :: " + $LogString
                  Out-File -FilePath $LogFilePath -inputobject $FullLineString -Append
                  Write-Host $FullLineString
              }
          }
          
          

           

          Usage is like either of the following:

          Logger("Log My Message")
          -- Or - for an empty line for visual white space in the log
          Logger("")
          
          

           

          Hope that helps .

          1 of 1 people found this helpful
          • 2. Re: powershell scripts runs but does not install .vsto package
            James_222 Rookie

            Thank you for the advice. I did add logging and also ran the package with the domain admin account. The logs are reporting the installation as successful and have not provided any clues. Logging on to the target PC after the attempted installation I am prompted to review a message from Interactive Services Detection that states that the program is not fully compatible with Windows. Programs requesting attention are c:\windows\system32\windowspowershell\v1.0\powershell.exe and c:\windows\system32\rundll32.exe.

             

            The PS script was written in 5.1 and the target has PS 5.1 installed so I am baffled by the PS v1.0 incompatibility message. Or is this something else?

            • 3. Re: powershell scripts runs but does not install .vsto package
              ldms_4mfe Specialist

              Maybe something with the bitness?

               

              What did you choose?

               

              If you choose nothing it runs with a 32-bit PS.

              • 4. Re: powershell scripts runs but does not install .vsto package
                phoffmann SupportEmployee

                Be careful about believing the "v1.0" lie ... even on a fully patched up Win-10 device (which never had Powershell 1.0) I've only got a "1.0" directory ...

                 

                 

                ... so you may want to re-verify what version of Powershell is on there (via "$PSVersionTable.PSVersion") ... you may want to spit out that output via a script, in case that there's some arcane method by which your script runs in 1.0 mode (which I don't think SHOULD be possible) when executed by EPM or so ...?

                 

                See this thread for info on determining version -- Determine installed PowerShell version - Stack Overflow -- ... might be that it's running in "something not your latest version" for some reason when executed by us (first I'd heard of it, but Powershell does do a few weird things...).