{"id":4088,"date":"2013-03-01T00:01:00","date_gmt":"2013-03-01T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/03\/01\/use-powershell-to-explore-windows-audio-drivers\/"},"modified":"2013-03-01T00:01:00","modified_gmt":"2013-03-01T00:01:00","slug":"use-powershell-to-explore-windows-audio-drivers","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-explore-windows-audio-drivers\/","title":{"rendered":"&#65279;Use PowerShell to Explore Windows Audio Drivers"},"content":{"rendered":"<p><strong>Summary<\/strong>: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore Windows audio drivers.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;Hey, Scripting Guy! I have a problem with one of my computers&mdash;the audio driver is causing me fits. I would like to know if I can use Windows PowerShell to explore this issue. I think it would be really valuable, because I might have this issue come up again. Can you help me?<\/p>\n<p>&mdash;DB<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Hello DB,<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Hey, it is almost the weekend. In celebration of almost the weekend, I decided to get up early, fix a pot of Irish steel-cut oats, and a nice pot of English Breakfast tea. While the oats cooked, I used my Windows Surface to check my email. DB, this is when I ran across your email. Yes, Windows PowerShell can help in many different ways in looking at audio drivers.<\/p>\n<h2>First, find the audio device<\/h2>\n<p>The first thing to do is to find the audio device. To do this, use the WMI class Win32_SoundDevice WMI class. The Win32_SoundDevice WMI class tells me the device ID and the name of the audio device. The command is shown here.<\/p>\n<p style=\"padding-left: 30px\">&nbsp;Get-CimInstance win32_sounddevice | fl *<\/p>\n<p>&nbsp;The command and its associated output are shown here.<\/p>\n<p>&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3487.HSG-3-1-13-01.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3487.HSG-3-1-13-01.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<h2>Next, find the driver<span style=\"font-size: 12px\">&nbsp;<\/span><\/h2>\n<p>Now that I know the name of the audio device, I can look for system drivers. To do this, I use the Win32_SystemDriver WMI class. I &ldquo;cheap out&rdquo; and pipe the results to the <strong>Where-Object<\/strong>. My resulting command is shown here. (<strong>gwmi<\/strong> is an alias for <strong>Get-WmiObject<\/strong>, <strong>?<\/strong> is an alias for <strong>Where-Object<\/strong>, and <strong>fl i<\/strong>s an alias for <strong>Format-List<\/strong>).&nbsp;<\/p>\n<p style=\"padding-left: 30px\">gwmi win32_systemdriver | ? caption -match &#8216;conexant&#8217; | fl *&nbsp;<\/p>\n<p>The command and its associated output are shown here.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8203.HSG-3-1-13-02.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8203.HSG-3-1-13-02.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<h2>Now get driver file info<\/h2>\n<p>Now that I have the path to the driver file, I can use the <strong>Get-Item<\/strong> cmdlet to retrieve version information. The first thing I need to do is to obtain the path to the driver. I can get this from the <strong>PathName<\/strong> property. I store it in a variable named <strong>$path<\/strong>. This is shown here.&nbsp;<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; $path = (gwmi win32_systemdriver | ? caption -match &#8216;conexant&#8217;).pathname&nbsp;<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; $path&nbsp;<\/p>\n<p style=\"padding-left: 30px\">C:\\WINDOWS\\system32\\drivers\\CHDRT64.sys<\/p>\n<p>Now I want to get only the <strong>VersionInfo <\/strong>property. To do this, I use the <strong>Get-Item<\/strong> cmdlet and return only <strong>VersionInfo<\/strong> as shown here.<\/p>\n<p style=\"padding-left: 30px\">PS C:\\&gt; (Get-Item $path).versioninfo&nbsp;<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">ProductVersion&nbsp;&nbsp; FileVersion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileName&nbsp;<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8211;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">8.32.43.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8.32.43.0 bui&#8230; C:\\WINDOWS\\system32\\drivers\\CHDRT64.sys&nbsp;<\/p>\n<p>Hmm&hellip;<\/p>\n<p>I know there is more information in this property, so I pipe it to the <strong>Format-List<\/strong> cmdlet as shown here.<\/p>\n<p style=\"padding-left: 30px\">(Get-Item $path).versioninfo | fl *<\/p>\n<p>The commands and the associated output are shown here.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6136.HSG-3-1-13-03.png\"><img decoding=\"async\" title=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6136.HSG-3-1-13-03.png\" alt=\"Image of command output\" \/><\/a><\/p>\n<p>DB, that is all there is to using Windows PowerShell to look at audio driver information.&nbsp; Join me tomorrow for the Weekend Scripter.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><strong>Ed Wilson, Microsoft Scripting Guy<\/strong>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore Windows audio drivers. &nbsp;Hey, Scripting Guy! I have a problem with one of my computers&mdash;the audio driver is causing me fits. I would like to know if I can use Windows PowerShell to explore this issue. I think it would be really [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[34,35,3,45,6],"class_list":["post-4088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-hardware","tag-peripherals-and-devices","tag-scripting-guy","tag-windows-powershell","tag-wmi"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore Windows audio drivers. &nbsp;Hey, Scripting Guy! I have a problem with one of my computers&mdash;the audio driver is causing me fits. I would like to know if I can use Windows PowerShell to explore this issue. I think it would be really [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=4088"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/4088\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=4088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=4088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=4088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}