如何在列标题中包含2个单词时使用过滤器

时间:2014-05-11 19:39:31

标签: windows powershell

PS C:\Users\admin> Import-Csv D:\ticket.csv | where-object {$_.Status -ne "closed"} | format-table ID,Status,Assign* 

ID                                            Status                                        Assigned Person                               Assigned Team                                
--                                            ------                                        ---------------                               --------------                               
45974                                         Hold                                          Abdoali Jhabuawala                            Database Administration Team                 
46288                                         Hold                                          Sandeep Manjrekar                             Email Applications Team                      
43182                                         Hold                                          Sahaj Bahra                                   Unix Administration Team                     
47147                                         Pending Vendor                                Vinay Sherkar                                 Storage Administration Team                  
46876                                         Hold                                          Yagnesh Ratnagrahi                            Windows Administration Team                  
46646                                         Assigned                                      Dhirendra Sharma                              Email Applications Team                      
33599                                         In Progress                                   Peter Charlton                                TSO Senior Manager Team                      
45914                                         Reopened                                                                                    Advance Digital Team                         
46538                                         In Progress                                   Ashutosh Malik                                Network Administration Team                  
32728                                         Assigned                                      Payal Jecob                                   Network Administration Team                  
43847                                         Hold                                          Michael Auleta                                Unix Administration Team                     
47690                                         Hold                                          Sourav Lahiri                                 Network Administration Team                  
47208                                         In Progress                                   Chetan Kulkarni                               Network Administration Team                  
20256                                         In Progress                                   Chetan Kulkarni                               Network Administration Team                  
47114                                         Assigned                                      Craig Holland                                 Network Administration Team                  
47113                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
38311                                         Hold                                          Michael Klimanov                              Email Applications Team                      
35056                                         In Progress                                   Tuong Luu                                     Unix Administration Team                     
47207                                         Assigned                                      Chetan Kulkarni                               Network Administration Team                  
45773                                         In Progress                                   Dennis Guilbault                              Network Administration Team                  
34344                                         In Progress                                   Michael McCleary                              Network Administration Team                  
36297                                         In Progress                                   Tuong Luu                                     Windows Administration Team                  
47786                                         Assigned                                      Andrew Demetratos                             Network Administration Team                  
47788                                         Assigned                                      Andrew Demetratos                             Network Administration Team                  
46251                                         In Progress                                   Himanshu Trivedi                              Database Administration Team                 
41167                                         Hold                                          William Burke                                 Email Applications Team                      
47562                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
47823                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
47836                                         Assigned                                      Chetan Kulkarni                               Network Administration Team                  
47838                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
47843                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
45487                                         In Progress                                   Bhupendra Bisen                               IP Voice and Video Team                      
45525                                         Hold                                          Bhupendra Bisen                               IP Voice and Video Team                      
47559                                         Assigned                                      Andrew Demetratos                             Network Administration Team                  
47864                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
42560                                         Assigned                                      Dennis Guilbault                              Network Administration Team                  
47564                                         Assigned                                      Michael McCleary                              Network Administration Team                  
47563                                         Assigned                                      Michael McCleary                              Network Administration Team                  
47263                                         In Progress                                                       Michael Klimanov                              Email Applications Team                      
47957                                         Hold                                          Payal Jecob                                   Network Administration Team                  
47958                                         Hold                                          Payal Jecob                                   Network Administration Team                  
47959                                         Assigned                                      Andrew Demetratos                             Network Administration Team                  
26662                                         Hold                                          Andrew Demetratos                             Network Administration Team                  
47997                                         Assigned                                                             Andrew Demetra                  

我只需要打印指定的团队,而不是指定的人员。此外,我还要打印除assigned team = IP VoiceVideo Team以外的所有行。

1 个答案:

答案 0 :(得分:1)

您可以使用空格引用属性名称。

尝试:

Import-Csv D:\ticket.csv |
Where-Object {($_.Status -ne "closed") -and ($_."assigned team" -ne "IP Voice and Video Team")} |
Format-Table -Property ID,Status,"Assigned Team"