{"id":99,"date":"2015-07-27T20:00:00","date_gmt":"2015-07-27T18:00:00","guid":{"rendered":"https:\/\/www.mosi.at\/ikt\/?p=99"},"modified":"2019-05-03T11:38:44","modified_gmt":"2019-05-03T09:38:44","slug":"powershell-vergleichs-operatoren-beispiele","status":"publish","type":"post","link":"https:\/\/www.mosi.at\/ikt\/2015\/07\/27\/powershell-vergleichs-operatoren-beispiele\/","title":{"rendered":"Powershell Vergleichs-Operatoren Beispiele"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Beispiel: Liste der ersten 10 Prozesse mit bekanntem Pfad (Pfad nicht leer).<br>\n<strong><span style=\"color: #003366;\">Get-Process | Where-Object { $_.Path -ne $null} | Select-Object -first 10 | FT Name, Company, Path -AutoSize<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\> Get-Process | Where-Object { $_.Path -ne $null} | Select-Object -first 10 | FT Name, Company, Path -AutoSize\n\nName                 Company                 Path\n----                 -------                 ----\nAnyDesk              philandro Software GmbH C:\\Program Files (x86)\\AnyDesk\\AnyDesk.exe\nApplicationFrameHost Microsoft Corporation   C:\\WINDOWS\\system32\\ApplicationFrameHost.exe\nconhost              Microsoft Corporation   C:\\WINDOWS\\system32\\conhost.exe\nconhost              Microsoft Corporation   C:\\WINDOWS\\system32\\conhost.exe\ndllhost              Microsoft Corporation   C:\\WINDOWS\\system32\\DllHost.exe\ndllhost              Microsoft Corporation   C:\\WINDOWS\\system32\\DllHost.exe\nepic                 Hidden Reflex Authors   C:\\Users\\smoretti\\AppData\\Local\\Epic Privacy Browser\\Application\\epic.exe\nepic                 Hidden Reflex Authors   C:\\Users\\smoretti\\AppData\\Local\\Epic Privacy Browser\\Application\\epic.exe\nepic                 Hidden Reflex Authors   C:\\Users\\smoretti\\AppData\\Local\\Epic Privacy Browser\\Application\\epic.exe\nepic                 Hidden Reflex Authors   C:\\Users\\smoretti\\AppData\\Local\\Epic Privacy Browser\\Application\\epic.exe\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Beispiel: Liste der ersten zehn Prozesse von 32 Bit Programmen.<br>\nHinweis: 32 Bit Programme sind im Ordner &#8222;&#8230;Program Files (x86)&#8230;&#8220; installiert.<br>\n<span style=\"color: #003300;\"><strong>Get-Process | Where-Object { $_.Path -match &#8222;(x86)&#8220;} | Select-Object -First 10 | FT Name, Company, Path -AutoSize<\/strong><\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\> Get-Process | Where-Object { $_.Path -match \"(x86)\"} | Select-Object -First 10 | FT Name, Company, Path -AutoSize\n\nName       Company                 Path\n----       -------                 ----\nAnyDesk    philandro Software GmbH C:\\Program Files (x86)\\AnyDesk\\AnyDesk.exe\nTeamViewer TeamViewer GmbH         C:\\Program Files (x86)\\TeamViewer\\TeamViewer.exe\nVCDDaemon  Elaborate Bytes AG      C:\\Program Files (x86)\\Elaborate Bytes\\VirtualCloneDrive\\VCDDaemon.exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Beispiel: Liste aller Prozesse die 64 Bit Programme sind.<br>\n<strong><span style=\"color: #003366;\">Get-Process | Where-Object { $_.Path -like &#8222;*Program Files\\*&#8220;} | FT Name, Company, Path -AutoSize<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\> Get-Process | Where-Object { $_.Path -like \u201e*Program Files\\*\u201c} | FT Name, Company, Path -AutoSize\n\nName                Company               Path\n----                -------               ----\nMicrosoft.Photos    Microsoft Corporation C:\\Program Files\\WindowsApps\\Microsoft.Windows.Photos_2019.19021.18010.0_x64__8wekyb3d8bbwe\\Microsoft.P...\nMSASCuiL            Microsoft Corporation C:\\Program Files\\Windows Defender\\MSASCuiL.exe\nnotepad++           Don HO don.h@free.fr  C:\\Program Files\\Notepad++\\notepad++.exe\nSkypeApp            Microsoft Corporation C:\\Program Files\\WindowsApps\\Microsoft.SkypeApp_14.42.60.0_x64__kzf8qxf38zg5c\\SkypeApp.exe\nSkypeBackgroundHost Microsoft Corporation C:\\Program Files\\WindowsApps\\Microsoft.SkypeApp_14.42.60.0_x64__kzf8qxf38zg5c\\SkypeBackgroundHost.exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">PS C:&gt; Get-Process | Where-Object { $_.Path -like \u201e*Program Files*\u201c} | FT Name, Company, Path -AutoSize<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PS C:&gt; Get-Process | Where-Object { $_.Path -like \u201e*Program Files*\u201c} | FT Name, Company, Path -AutoSize<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\> Get-Process | Where-Object { $_.Path -like \u201e*Program Files*\u201c} | FT Name, Company, Path -AutoSize\n\nName                Company                 Path\n----                -------                 ----\nAnyDesk             philandro Software GmbH C:\\Program Files (x86)\\AnyDesk\\AnyDesk.exe\nMicrosoft.Photos    Microsoft Corporation   C:\\Program Files\\WindowsApps\\Microsoft.Windows.Photos_2019.19021.18010.0_x64__8wekyb3d8bbwe\\Microsoft...\nMSASCuiL            Microsoft Corporation   C:\\Program Files\\Windows Defender\\MSASCuiL.exe\nnotepad++           Don HO don.h@free.fr    C:\\Program Files\\Notepad++\\notepad++.exe\nSkypeApp            Microsoft Corporation   C:\\Program Files\\WindowsApps\\Microsoft.SkypeApp_14.42.60.0_x64__kzf8qxf38zg5c\\SkypeApp.exe\nSkypeBackgroundHost Microsoft Corporation   C:\\Program Files\\WindowsApps\\Microsoft.SkypeApp_14.42.60.0_x64__kzf8qxf38zg5c\\SkypeBackgroundHost.exe\nTeamViewer          TeamViewer GmbH         C:\\Program Files (x86)\\TeamViewer\\TeamViewer.exe\nVCDDaemon           Elaborate Bytes AG      C:\\Program Files (x86)\\Elaborate Bytes\\VirtualCloneDrive\\VCDDaemon.exe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Beispiel: Liste aller Commandlets mit eingebautem Fernaufruf.<br>\n<strong><span style=\"color: #003366;\">Get-Command | Where-Object { $_.Parameters.keys -contains &#8222;ComputerName&#8220; -and  $_.Parameters.keys -notcontains &#8222;Session&#8220;} | FT Name, ModuleName -AutoSize<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> PS C:\\> Get-Command | Where-Object { $_.Parameters.keys -contains \"ComputerName\" -and  $_.Parameters.keys -notcontains \"Session\"} | FT Name, ModuleNa\nme -AutoSize\n\nName              ModuleName\n----              ----------\nAdd-Computer      Microsoft.PowerShell.Management\nClear-EventLog    Microsoft.PowerShell.Management\nGet-EventLog      Microsoft.PowerShell.Management\nGet-HotFix        Microsoft.PowerShell.Management\nGet-Process       Microsoft.PowerShell.Management\nGet-PSSession     Microsoft.PowerShell.Core\nGet-Service       Microsoft.PowerShell.Management\nGet-WmiObject     Microsoft.PowerShell.Management\nInvoke-WmiMethod  Microsoft.PowerShell.Management\nLimit-EventLog    Microsoft.PowerShell.Management\nNew-EventLog      Microsoft.PowerShell.Management\nRegister-WmiEvent Microsoft.PowerShell.Management\nRemove-Computer   Microsoft.PowerShell.Management\nRemove-EventLog   Microsoft.PowerShell.Management\nRemove-WmiObject  Microsoft.PowerShell.Management\nRename-Computer   Microsoft.PowerShell.Management\nRestart-Computer  Microsoft.PowerShell.Management\nSet-Service       Microsoft.PowerShell.Management\nSet-WmiInstance   Microsoft.PowerShell.Management\nShow-EventLog     Microsoft.PowerShell.Management\nStop-Computer     Microsoft.PowerShell.Management\nTest-Connection   Microsoft.PowerShell.Management\nWrite-EventLog    Microsoft.PowerShell.Management<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Beispiel: Liste der ersten 10 Prozesse mit bekanntem Pfad (Pfad nicht leer). Get-Process | Where-Object { $_.Path -ne $null} | Select-Object -first 10 | FT Name, Company, Path -AutoSize Beispiel: Liste der ersten zehn Prozesse von 32 Bit Programmen. Hinweis: 32 Bit Programme sind im Ordner &#8222;&#8230;Program Files (x86)&#8230;&#8220; installiert. Get-Process | Where-Object { $_.Path [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_front_end_style_editor":"no","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","osp_disable_panel":"default","osh_disable_topbar_sticky":"default","osh_disable_header_sticky":"default","osh_sticky_header_style":"default","osh_sticky_header_effect":"","osh_custom_sticky_logo":0,"osh_custom_retina_sticky_logo":0,"osh_custom_sticky_logo_height":0,"osh_background_color":"","osh_links_color":"","osh_links_hover_color":"","osh_links_active_color":"","osh_links_bg_color":"","osh_links_hover_bg_color":"","osh_links_active_bg_color":"","osh_menu_social_links_color":"","osh_menu_social_hover_links_color":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[9,20,18,16],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-__news","category-power-shell","category-scripts","category-windows","entry"],"_links":{"self":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}