{"id":50,"date":"2015-12-29T08:48:21","date_gmt":"2015-12-29T07:48:21","guid":{"rendered":"http:\/\/backes.nu\/?p=50"},"modified":"2016-06-15T08:14:17","modified_gmt":"2016-06-15T06:14:17","slug":"exportera-importera-boot-image-drivrutiner","status":"publish","type":"post","link":"https:\/\/backes.nu\/index.php\/2015\/12\/29\/exportera-importera-boot-image-drivrutiner\/","title":{"rendered":"Exportera \/ Importera Boot-image drivrutiner till ny Boot-image"},"content":{"rendered":"<p>\u00c5terigen, ett mycket bra PowerShell-script som besparar massa tid.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">Function Export-BootImageDrivers {\r\n    PARAM (\r\n        &#x5B;String] $ImageId,\r\n        &#x5B;String] $ExportXml\r\n    )\r\n  \r\n    $drivers = @{}\r\n    (Get-CMBootImage -Id $ImageId).ReferencedDrivers | ForEach-Object {\r\n        Write-Verbose &quot;Found driver ID - $($_.Id)&quot;\r\n \r\n        $drivers.Add($_.Id, $_.SourcePath)\r\n    }\r\n \r\n    $drivers | Export-Clixml -Path $ExportXml\r\n}\r\n \r\nFunction Import-BootImageDrivers {\r\n    PARAM (\r\n        &#x5B;String] $ImageId,\r\n        &#x5B;String] $ExportXml\r\n    )\r\n \r\n    $BootImage = Get-CMBootImage -Id $ImageId\r\n    $drivers = Import-Clixml -Path $ExportXml\r\n    $drivers.GetEnumerator() | ForEach-Object {\r\n        Write-Verbose &quot;Adding driver ID - $($_.Name)&quot;\r\n        Set-CMDriver -Id $_.Name -AddBootImagePackage $BootImage -UpdateDistributionPointsforBootImagePackage $false -Force\r\n    }\r\n}<\/pre>\n<p>Exportera f\u00f6rst drivrutinerna<\/p>\n<p>Export-BootImageDrivers -ImageId &#8220;ABC00123&#8221; -ExportXml &#8220;D:\\Script\\PS\\drivers.xml&#8221;<\/p>\n<p>Uppgradera Boot-imagen<\/p>\n<p>Sedan importera drivrutinerna<\/p>\n<p>Import-BootImageDrivers -ImageId &#8220;ABC00345&#8221; -ExportXml &#8220;D:\\Script\\PS\\drivers.xml&#8221;<\/p>\n<p>Tack till Rikard R\u00f6nnkvist, k\u00e4lla: <a href=\"http:\/\/www.snowland.se\/2015\/09\/03\/export-import-boot-image-drivers-needed-before-adk-upgrade\/\" target=\"_blank\">SnowLand<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c5terigen, ett mycket bra PowerShell-script som besparar massa tid. Function Export-BootImageDrivers { PARAM ( &#x5B;String] $ImageId, &#x5B;String] $ExportXml ) $drivers = @{} (Get-CMBootImage -Id $ImageId).ReferencedDrivers | ForEach-Object { Write-Verbose &quot;Found driver ID &#8211; $($_.Id)&quot; $drivers.Add($_.Id, $_.SourcePath) } $drivers | Export-Clixml&#8230;..<\/p>\n","protected":false},"author":1,"featured_media":92,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[47,12],"tags":[24,23,11,25,27,22,26],"class_list":["post-50","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-notmine","category-note-to-myself","tag-boot-image","tag-drivrutiner","tag-kneget","tag-powershell","tag-riro","tag-sccm","tag-snowland"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/backes.nu\/wp-content\/uploads\/2016\/04\/maxresdefault.jpg?fit=1920%2C1080&ssl=1","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Cu3K-O","_links":{"self":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":2,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions\/94"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media\/92"}],"wp:attachment":[{"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/backes.nu\/index.php\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}