{"id":2188,"date":"2020-09-23T22:00:59","date_gmt":"2020-09-23T20:00:59","guid":{"rendered":"https:\/\/www.mosi.at\/ikt\/?p=2188"},"modified":"2020-09-23T22:06:15","modified_gmt":"2020-09-23T20:06:15","slug":"mit-powershell-get-wmiobject-get-ciminstance-ps-51-scripts-zu-ps7","status":"publish","type":"post","link":"https:\/\/www.mosi.at\/ikt\/2020\/09\/23\/mit-powershell-get-wmiobject-get-ciminstance-ps-51-scripts-zu-ps7\/","title":{"rendered":"Mit Powershell: Get-wmiobject, Get-CimInstance  PS 5.1 Scripts zu PS7"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">PowerShell 7 unterst\u00fctzt Get-wmiobject win32_logicaldiskl&#8230; nicht mehr, da Powershell 7 auf .Net Core basiert. .Net Core unterst\u00fctzt WMI nicht mehr. Es mu\u00df daher CIM stattdessen verwendet werden . <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PowerShell 5.1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-wmiobject win32_logicaldisk ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">PowerShell 7<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-CimInstance win32_logicaldisk <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Die WMI-Cmdlets sind in PS 7 veraltet. Sie k\u00f6nnen trotzdem weiterhin mit WMI \/ CIM arbeiten, indem Sie Cmdlets aus dem Cimcmdlets-Modul in PS 7 verwenden. Das geht so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get-command -module cimcmdlets\nget-command -module cimcmdlets |measure<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>get-ciminstance<\/strong> ist fast dasselbe wie <strong>get-wmiobject<\/strong>. Jedoch wird bei Remotecomputern wsman anstelle von dcom verwendet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell 7 unterst\u00fctzt Get-wmiobject win32_logicaldiskl&#8230; nicht mehr, da Powershell 7 auf .Net Core basiert. .Net Core unterst\u00fctzt WMI nicht mehr. Es mu\u00df daher CIM stattdessen verwendet werden . PowerShell 5.1 PowerShell 7 Die WMI-Cmdlets sind in PS 7 veraltet. Sie k\u00f6nnen trotzdem weiterhin mit WMI \/ CIM arbeiten, indem Sie Cmdlets aus dem Cimcmdlets-Modul in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1899,"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,12,11,20,110,111,18,10,16,24,96],"tags":[],"class_list":["post-2188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-__news","category-anwendungssoftware","category-betriebssysteme","category-power-shell","category-powershell-5-1","category-powershell-7","category-scripts","category-software","category-windows","category-windows-10","category-windows-10-home","entry","has-media"],"_links":{"self":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts\/2188","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=2188"}],"version-history":[{"count":3,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts\/2188\/revisions"}],"predecessor-version":[{"id":2192,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/posts\/2188\/revisions\/2192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/media\/1899"}],"wp:attachment":[{"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/media?parent=2188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/categories?post=2188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mosi.at\/ikt\/wp-json\/wp\/v2\/tags?post=2188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}