{"id":4178,"date":"2024-05-09T07:53:53","date_gmt":"2024-05-09T06:53:53","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=4178"},"modified":"2024-05-09T07:53:53","modified_gmt":"2024-05-09T06:53:53","slug":"multi-threading-in-addrs","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2024\/05\/multi-threading-in-addrs\/","title":{"rendered":"Multi threading in ADDRS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve added basic multi-threading to ADDRS: <a href=\"https:\/\/www.powershellgallery.com\/packages\/ADDRS\/1.1.8\">https:\/\/www.powershellgallery.com\/packages\/ADDRS\/1.1.8<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This solely ensures that the most compute intensive task (caching sizes\/performance) is not repeated between jobs. You&#8217;ll still have to handle running multiple jobs using your own preferred method, e.g. foreach -parallel, runspaces or start-job. Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n$scriptBlock = {\n    Param(\n        $vm,\n        $measurePeriodHours,\n        $workspace,\n        $token\n    )\n    import-module ADDRS -force\n    Login-AzAccount -AccessToken $token.Token -AccountId $token.UserId -Tenant $token.TenantId\n    set-vmRightSize -doNotCheckForRecentResize -targetVMName $vm.Name -domain \"lieben.nu\" -measurePeriodHours $measurePeriodHours -workspaceId $workspace.CustomerId -Verbose -maintenanceWindowStartHour 22 -maintenanceWindowLengthInHours 3 -maintenanceWindowDay 6\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve added basic multi-threading to ADDRS: https:\/\/www.powershellgallery.com\/packages\/ADDRS\/1.1.8 This solely ensures that the most compute intensive task (caching sizes\/performance) is not repeated between jobs. You&#8217;ll still have to handle running multiple jobs using your own preferred method, e.g. foreach -parallel, runspaces or start-job. Example:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[4,5,6,39],"tags":[],"class_list":["post-4178","post","type-post","status-publish","format-standard","hentry","category-automation","category-azure","category-windows-virtual-desktop","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/4178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=4178"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/4178\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=4178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=4178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=4178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}