Задайте вопросЗадайте вопрос
 

ВопросOutput changes depending upon order of commands and previous commands

  • 30 июня 2009 г. 16:08CodeSlinger Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     С кодом
    Try running the following script from a V2 PowerShell, then reverse the order of some of the commands. I am running this on PS V2 on Windows 7 RC. I thought just a weird outputting bug but according to Bob Landau on the PS newgroup, the explanation for the 2 weird output behaviours, though still a bug, is that the default formator is being changed from Format-Table to Format-List. Would be great if Microsoft took this on as a bug if it really is since I did not have good luck with the Connect site trying to report it as such.
    
    Thanks, Dave
    
    "-------------------------------------"
    "Start of PS scripting test"
    "-------------------------------------"
    
    # weirdness #1 - the output of the following commands each change depending on the order of each
    # weirdness #2 - subsequent commands do not have header information and have same format as the first
    "`nOutput from get-process..."
    get-process
    "`nOutput from dir..."
    dir
    "`nOutput from get-process..."
    get-process
    "`nOutput from dir..."
    dir
    
    "-------------------------------------"
    "End of PS scripting test"
    "-------------------------------------"
    
    
    

Все ответы