{"id":33,"date":"2021-11-09T08:14:10","date_gmt":"2021-11-09T08:14:10","guid":{"rendered":"https:\/\/blog.packetism.com\/?p=33"},"modified":"2021-11-11T07:31:25","modified_gmt":"2021-11-11T07:31:25","slug":"filter-in-powershell-with-where-object","status":"publish","type":"post","link":"https:\/\/blog.packetism.com\/index.php\/2021\/11\/09\/filter-in-powershell-with-where-object\/","title":{"rendered":"Filter in PowerShell with Where-Object"},"content":{"rendered":"\n<p>In almost every scripting language that need to filter unique information is almost a must. Here is one simple way to file use Where-Object.<\/p>\n\n\n\n<p><code>Get-Service<\/code> | <code>Where-Object -Property Name -Contains 'ALS'<\/code><\/p>\n\n\n\n<p><strong>Command Breakdown<\/strong><\/p>\n\n\n\n<p><code>Get-Service<\/code> is used for find services running on your given workstation<\/p>\n\n\n\n<p><code>Where-Object<\/code> is used to filter the information after running the <code>Get-Service<\/code> command<br><code>-Property Name<\/code> specifies the type of information usually the header (i.e. column title)<br><code>-Contains \u2018ALS\u2019<\/code> specifies the particular character to search for<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In almost every scripting language that need to filter unique information is almost a must&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":57,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[5],"tags":[],"featured_image_urls":{"full":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-scaled.jpg",2560,1707,false],"thumbnail":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-150x150.jpg",150,150,true],"medium":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-300x200.jpg",300,200,true],"medium_large":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-768x512.jpg",640,427,true],"large":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-1024x683.jpg",640,427,true],"1536x1536":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-1536x1024.jpg",1536,1024,true],"2048x2048":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-2048x1365.jpg",2048,1365,true],"newsup-slider-full":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-1280x720.jpg",1280,720,true],"newsup-featured":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-1024x683.jpg",1024,683,true],"newsup-medium":["https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-720x380.jpg",720,380,true]},"author_info":{"display_name":"Packetism","author_link":"https:\/\/blog.packetism.com\/index.php\/author\/packetism\/"},"category_info":"<a href=\"https:\/\/blog.packetism.com\/index.php\/category\/how-to-powershell\/\" rel=\"category tag\">How To | PowerShell<\/a>","tag_info":"How To | PowerShell","comment_count":"0","jetpack_featured_media_url":"https:\/\/blog.packetism.com\/wp-content\/uploads\/2021\/11\/pexels-markus-spiske-360591-scaled.jpg","_links":{"self":[{"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":1,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":34,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/posts\/33\/revisions\/34"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.packetism.com\/index.php\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}