{"id":1052,"date":"2014-07-04T11:59:00","date_gmt":"2014-07-04T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/07\/04\/powertip-difference-between-xml-powershell-cmdlets\/"},"modified":"2014-07-04T11:59:00","modified_gmt":"2014-07-04T11:59:00","slug":"powertip-difference-between-xml-powershell-cmdlets","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-difference-between-xml-powershell-cmdlets\/","title":{"rendered":"PowerTip: Difference Between XML PowerShell Cmdlets"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Understand the difference between XML cmdlets in Windows PowerShell.<\/span><\/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;What is the difference between the Windows PowerShell cmdlets,&nbsp;<b>Export-CliXML<\/b>&nbsp;and&nbsp;<b>ConvertTo-XML<\/b>?<\/p>\n<p style=\"margin-left:30px\"><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;The Help file for&nbsp;<b>ConvertTo-XML&nbsp;<\/b>says:<\/p>\n<p style=\"margin-left:60px\">&#8220;This cmdlet is similar to Export-CliXML, except that Export-CliXML stores the resulting XML in a file. <br \/>ConvertTo-XML returns the XML, so you can continue to process it in Windows PowerShell.&#8221;<\/p>\n<p style=\"margin-left:60px\">The&nbsp;<b>Export<\/b>&nbsp;verb encapsulates your objects in a persistent data store (such as a file) or into an <br \/>interchange format. The&nbsp;<b>ConvertTo&nbsp;<\/b>verb simply changes the objects in the pipeline for continued use. <br \/>If you follow&nbsp;<b>ConvertTo-XML<\/b>&nbsp;with&nbsp;<b>Out-File<\/b>, you would get similar results to&nbsp;<b>Export-CliXML<\/b>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Understand the difference between XML cmdlets in Windows PowerShell. &nbsp;What is the difference between the Windows PowerShell cmdlets,&nbsp;Export-CliXML&nbsp;and&nbsp;ConvertTo-XML? &nbsp;The Help file for&nbsp;ConvertTo-XML&nbsp;says: &#8220;This cmdlet is similar to Export-CliXML, except that Export-CliXML stores the resulting XML in a file. ConvertTo-XML returns the XML, so you can continue to process it in Windows PowerShell.&#8221; The&nbsp;Export&nbsp;verb encapsulates [&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":[317,56,356,3,45],"class_list":["post-1052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-gary-siepser","tag-guest-blogger","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Understand the difference between XML cmdlets in Windows PowerShell. &nbsp;What is the difference between the Windows PowerShell cmdlets,&nbsp;Export-CliXML&nbsp;and&nbsp;ConvertTo-XML? &nbsp;The Help file for&nbsp;ConvertTo-XML&nbsp;says: &#8220;This cmdlet is similar to Export-CliXML, except that Export-CliXML stores the resulting XML in a file. ConvertTo-XML returns the XML, so you can continue to process it in Windows PowerShell.&#8221; The&nbsp;Export&nbsp;verb encapsulates [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1052","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=1052"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/1052\/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=1052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=1052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=1052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}