3 Replies Latest reply on Jul 19, 2019 3:54 AM by Deepak Bhola

    Powershell encoding response

    Natali Nogueira
      Share This:

      Hi,

       

      We are executing dsquery by powershell module and we are passing a string with special character, but the response is returning: Restri‡ao.

      We are passing character set UTF-8.

       

      <powershell-output>

        <metadata>

          <status>success</status>

        </metadata>

        <targets-output>

          <target-output>

            <metadata>

              <os-id>Windows Server 2008</os-id>

              <os-version></os-version>

              <status>success</status>

            </metadata>

            <commands-output>

              <command-output>

                <metadata>

                  <command>dsquery group -name 'Restrição de Envio'</command>

                  <line-count>1</line-count>

                  <execution-milliseconds>625</execution-milliseconds>

                  <exit-code>0</exit-code>

                  <status>success</status>

                </metadata>

                <output>

                  <line index="1">"CN=Restri‡ao de Envio"</line>

                </output>

              </command-output>

            </commands-output>

          </target-output>

        </targets-output>

      </powershell-output>

       

       

      Thank you.

        • 1. Re: Powershell enconding response
          Deepak Bhola

          Are you executing this command remotely or on localhost where adapter is enabled? What is the locale and language?

          • 2. Re: Powershell enconding response
            Natali Nogueira

            We are executing on localhost where adapter is enabled.

             

            Get-WinSystemLocale

            LCID             Name             DisplayName                                                                         

            ----             ----             -----------                                                                         

            1033             en-US            English (United States)                                    

             

            ç is a Portuguese character.                       

            • 3. Re: Powershell encoding response
              Deepak Bhola

              ok, Seems like issue with chcp code page. Can you try providing below additional inputs (assuming you are executing these commands in localhost and Powershell PSRemoting is enabled on host) in Autopilot Powershell with the command and see if you get the correct output with expected character set data. But for this you need to upgrade your adapter to 20.19.01 version of content.