How set preference `$ErrorView = “CategoryView”` before start powershell.exe The Next CEO of Stack OverflowHow can I set up an editor to work with Git on Windows?How can I develop for iPhone using a Windows development machine?How can you find out which process is listening on a port on Windows?How do I shutdown, restart, or log off Windows via a bat file?Git on Windows: How do you set up a mergetool?Setting Windows PowerShell path variableHow to run a PowerShell scriptHow do I install pip on Windows?How do I negate a condition in PowerShell?Can't start Eclipse - Java was started but returned exit code=13

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

Why do remote companies require working in the US?

How did the Bene Gesserit know how to make a Kwisatz Haderach?

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

How to count occurrences of text in a file?

How do I avoid eval and parse?

Is 'diverse range' a pleonastic phrase?

Why does the UK parliament need a vote on the political declaration?

Won the lottery - how do I keep the money?

Has this building technique been used in an official set?

Can we say or write : "No, it'sn't"?

Received an invoice from my ex-employer billing me for training; how to handle?

Are there any limitations on attacking while grappling?

Several mode to write the symbol of a vector

Why didn't Khan get resurrected in the Genesis Explosion?

What is "(CFMCC)" on an ILS approach chart?

How to avoid supervisors with prejudiced views?

Contours of a clandestine nature

In excess I'm lethal

Is micro rebar a better way to reinforce concrete than rebar?

Would a completely good Muggle be able to use a wand?

What exact does MIB represent in SNMP? How is it different from OID?

Why does standard notation not preserve intervals (visually)

What does "Its cash flow is deeply negative" mean?



How set preference `$ErrorView = “CategoryView”` before start powershell.exe



The Next CEO of Stack OverflowHow can I set up an editor to work with Git on Windows?How can I develop for iPhone using a Windows development machine?How can you find out which process is listening on a port on Windows?How do I shutdown, restart, or log off Windows via a bat file?Git on Windows: How do you set up a mergetool?Setting Windows PowerShell path variableHow to run a PowerShell scriptHow do I install pip on Windows?How do I negate a condition in PowerShell?Can't start Eclipse - Java was started but returned exit code=13










1















How to set preference $ErrorView = "CategoryView" before start powershell.exe ?



powershell.exe -command "$ErrorView = "CategoryView" ; dir wrong.txt" doesnt work.










share|improve this question
























  • set it in your $profile, I suppose.

    – Gert Jan Kraaijeveld
    Mar 7 at 16:45











  • I'm need this only for one operation

    – ilw
    Mar 7 at 16:46















1















How to set preference $ErrorView = "CategoryView" before start powershell.exe ?



powershell.exe -command "$ErrorView = "CategoryView" ; dir wrong.txt" doesnt work.










share|improve this question
























  • set it in your $profile, I suppose.

    – Gert Jan Kraaijeveld
    Mar 7 at 16:45











  • I'm need this only for one operation

    – ilw
    Mar 7 at 16:46













1












1








1


1






How to set preference $ErrorView = "CategoryView" before start powershell.exe ?



powershell.exe -command "$ErrorView = "CategoryView" ; dir wrong.txt" doesnt work.










share|improve this question
















How to set preference $ErrorView = "CategoryView" before start powershell.exe ?



powershell.exe -command "$ErrorView = "CategoryView" ; dir wrong.txt" doesnt work.







windows powershell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 20:03







ilw

















asked Mar 7 at 16:35









ilwilw

1,31111941




1,31111941












  • set it in your $profile, I suppose.

    – Gert Jan Kraaijeveld
    Mar 7 at 16:45











  • I'm need this only for one operation

    – ilw
    Mar 7 at 16:46

















  • set it in your $profile, I suppose.

    – Gert Jan Kraaijeveld
    Mar 7 at 16:45











  • I'm need this only for one operation

    – ilw
    Mar 7 at 16:46
















set it in your $profile, I suppose.

– Gert Jan Kraaijeveld
Mar 7 at 16:45





set it in your $profile, I suppose.

– Gert Jan Kraaijeveld
Mar 7 at 16:45













I'm need this only for one operation

– ilw
Mar 7 at 16:46





I'm need this only for one operation

– ilw
Mar 7 at 16:46












2 Answers
2






active

oldest

votes


















2














your code has a serious error in it. you used 4 double quotes instead of two on the outside and a pair of single quotes on the inside. [grin]



this works ...



powershell.exe -command "$ErrorView = 'CategoryView' ; dir wrong.txt; pause"


remove the pause when you are certain things are working as needed. [grin]






share|improve this answer
































    0














    To complement Lee Dailey's helpful answer: As Lee points out, your primary problem is that you neglected to escape the " chars. embedded in your overall "..." command.



    Assuming that you're calling your command from outside of PowerShell, such as from cmd.exe (Command Prompt):



    • Using embedded single-quoting ('...') in lieu of the embedded "..." is an option in this case, as shown in Lee's answer, because CategoryView is to be treated as a literal string.

      Using ' for the embedded quoting conveniently obviates the need for escaping.



    • However, in cases where the embedded string contains variable references (e.g., $var) or expressions (e.g, $(Get-Date)), use of a double-quoted string ("...") is a must, because only double-quoted strings are expandable (interpolated). Escaping the embedded " as " is then a must.



      • Note that, by contrast, inside PowerShell " chars. must be escaped as `".


    # From cmd.exe, for instance.
    C:>powershell.exe -command "$ErrorView = "CategoryView"; dir wrong.txt"



    If, for some reason, you must invoke another PowerShell instance from within PowerShell, use a script block ( ... ), which also obviates the need for escaping (and better integrates with the calling session by returning objects from the invocation, not just strings).



    # From Powershell.
    PS> powershell.exe -command $ErrorView = "CategoryView" ; dir wrong.txt





    share|improve this answer

























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55048729%2fhow-set-preference-errorview-categoryview-before-start-powershell-exe%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      your code has a serious error in it. you used 4 double quotes instead of two on the outside and a pair of single quotes on the inside. [grin]



      this works ...



      powershell.exe -command "$ErrorView = 'CategoryView' ; dir wrong.txt; pause"


      remove the pause when you are certain things are working as needed. [grin]






      share|improve this answer





























        2














        your code has a serious error in it. you used 4 double quotes instead of two on the outside and a pair of single quotes on the inside. [grin]



        this works ...



        powershell.exe -command "$ErrorView = 'CategoryView' ; dir wrong.txt; pause"


        remove the pause when you are certain things are working as needed. [grin]






        share|improve this answer



























          2












          2








          2







          your code has a serious error in it. you used 4 double quotes instead of two on the outside and a pair of single quotes on the inside. [grin]



          this works ...



          powershell.exe -command "$ErrorView = 'CategoryView' ; dir wrong.txt; pause"


          remove the pause when you are certain things are working as needed. [grin]






          share|improve this answer















          your code has a serious error in it. you used 4 double quotes instead of two on the outside and a pair of single quotes on the inside. [grin]



          this works ...



          powershell.exe -command "$ErrorView = 'CategoryView' ; dir wrong.txt; pause"


          remove the pause when you are certain things are working as needed. [grin]







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 8 at 14:28

























          answered Mar 7 at 17:04









          Lee_DaileyLee_Dailey

          2,5561811




          2,5561811























              0














              To complement Lee Dailey's helpful answer: As Lee points out, your primary problem is that you neglected to escape the " chars. embedded in your overall "..." command.



              Assuming that you're calling your command from outside of PowerShell, such as from cmd.exe (Command Prompt):



              • Using embedded single-quoting ('...') in lieu of the embedded "..." is an option in this case, as shown in Lee's answer, because CategoryView is to be treated as a literal string.

                Using ' for the embedded quoting conveniently obviates the need for escaping.



              • However, in cases where the embedded string contains variable references (e.g., $var) or expressions (e.g, $(Get-Date)), use of a double-quoted string ("...") is a must, because only double-quoted strings are expandable (interpolated). Escaping the embedded " as " is then a must.



                • Note that, by contrast, inside PowerShell " chars. must be escaped as `".


              # From cmd.exe, for instance.
              C:>powershell.exe -command "$ErrorView = "CategoryView"; dir wrong.txt"



              If, for some reason, you must invoke another PowerShell instance from within PowerShell, use a script block ( ... ), which also obviates the need for escaping (and better integrates with the calling session by returning objects from the invocation, not just strings).



              # From Powershell.
              PS> powershell.exe -command $ErrorView = "CategoryView" ; dir wrong.txt





              share|improve this answer





























                0














                To complement Lee Dailey's helpful answer: As Lee points out, your primary problem is that you neglected to escape the " chars. embedded in your overall "..." command.



                Assuming that you're calling your command from outside of PowerShell, such as from cmd.exe (Command Prompt):



                • Using embedded single-quoting ('...') in lieu of the embedded "..." is an option in this case, as shown in Lee's answer, because CategoryView is to be treated as a literal string.

                  Using ' for the embedded quoting conveniently obviates the need for escaping.



                • However, in cases where the embedded string contains variable references (e.g., $var) or expressions (e.g, $(Get-Date)), use of a double-quoted string ("...") is a must, because only double-quoted strings are expandable (interpolated). Escaping the embedded " as " is then a must.



                  • Note that, by contrast, inside PowerShell " chars. must be escaped as `".


                # From cmd.exe, for instance.
                C:>powershell.exe -command "$ErrorView = "CategoryView"; dir wrong.txt"



                If, for some reason, you must invoke another PowerShell instance from within PowerShell, use a script block ( ... ), which also obviates the need for escaping (and better integrates with the calling session by returning objects from the invocation, not just strings).



                # From Powershell.
                PS> powershell.exe -command $ErrorView = "CategoryView" ; dir wrong.txt





                share|improve this answer



























                  0












                  0








                  0







                  To complement Lee Dailey's helpful answer: As Lee points out, your primary problem is that you neglected to escape the " chars. embedded in your overall "..." command.



                  Assuming that you're calling your command from outside of PowerShell, such as from cmd.exe (Command Prompt):



                  • Using embedded single-quoting ('...') in lieu of the embedded "..." is an option in this case, as shown in Lee's answer, because CategoryView is to be treated as a literal string.

                    Using ' for the embedded quoting conveniently obviates the need for escaping.



                  • However, in cases where the embedded string contains variable references (e.g., $var) or expressions (e.g, $(Get-Date)), use of a double-quoted string ("...") is a must, because only double-quoted strings are expandable (interpolated). Escaping the embedded " as " is then a must.



                    • Note that, by contrast, inside PowerShell " chars. must be escaped as `".


                  # From cmd.exe, for instance.
                  C:>powershell.exe -command "$ErrorView = "CategoryView"; dir wrong.txt"



                  If, for some reason, you must invoke another PowerShell instance from within PowerShell, use a script block ( ... ), which also obviates the need for escaping (and better integrates with the calling session by returning objects from the invocation, not just strings).



                  # From Powershell.
                  PS> powershell.exe -command $ErrorView = "CategoryView" ; dir wrong.txt





                  share|improve this answer















                  To complement Lee Dailey's helpful answer: As Lee points out, your primary problem is that you neglected to escape the " chars. embedded in your overall "..." command.



                  Assuming that you're calling your command from outside of PowerShell, such as from cmd.exe (Command Prompt):



                  • Using embedded single-quoting ('...') in lieu of the embedded "..." is an option in this case, as shown in Lee's answer, because CategoryView is to be treated as a literal string.

                    Using ' for the embedded quoting conveniently obviates the need for escaping.



                  • However, in cases where the embedded string contains variable references (e.g., $var) or expressions (e.g, $(Get-Date)), use of a double-quoted string ("...") is a must, because only double-quoted strings are expandable (interpolated). Escaping the embedded " as " is then a must.



                    • Note that, by contrast, inside PowerShell " chars. must be escaped as `".


                  # From cmd.exe, for instance.
                  C:>powershell.exe -command "$ErrorView = "CategoryView"; dir wrong.txt"



                  If, for some reason, you must invoke another PowerShell instance from within PowerShell, use a script block ( ... ), which also obviates the need for escaping (and better integrates with the calling session by returning objects from the invocation, not just strings).



                  # From Powershell.
                  PS> powershell.exe -command $ErrorView = "CategoryView" ; dir wrong.txt






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 8 at 14:30

























                  answered Mar 8 at 3:43









                  mklement0mklement0

                  137k22255293




                  137k22255293



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55048729%2fhow-set-preference-errorview-categoryview-before-start-powershell-exe%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                      Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                      How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page