{"id":36946,"date":"2025-02-26T09:49:14","date_gmt":"2025-02-26T08:49:14","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=36946"},"modified":"2025-02-26T09:49:16","modified_gmt":"2025-02-26T08:49:16","slug":"starting-with-powershell-7-and-parallelization","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/","title":{"rendered":"Starting with PowerShell 7 and parallelization"},"content":{"rendered":"\n<p>For the time being Windows PowerShell 5.1 is installed with Windows Server. It means that if you want to use or even test PowerShell 7 you need to install it by your own.<br>To be honest, even if I&#8217;m using PowerShell as a DBA more or less every day, I did not take too much care of PowerShell 7 until I used it at a customer place with a new parallelization functionality that we will discuss later on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-introduction\">Introduction<\/h2>\n\n\n\n<p>For reminder, PowerShell 7 is an open-source and cross-platform edition of PowerShell. It means that it can be used on Windows platforms but also on MacOS or Linux.<br>The good point is that you can install it without removing Windows PowerShell 5.1. Both version can cohabit because of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Separate installation path and executable name\n<ul class=\"wp-block-list\">\n<li>path with 5.1 like $env:WINDIR\\System32\\WindowsPowerShell\\v1.0<\/li>\n\n\n\n<li>path with 7 like $env:ProgramFiles\\PowerShell\\7<\/li>\n\n\n\n<li>executable with PowerShell 5.1 is powershell.exe and with PowerShell 7 is pwsh.exe<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Separate PSModulePath<\/li>\n\n\n\n<li>Separate profiles for each version\n<ul class=\"wp-block-list\">\n<li>path with 5.1 is $HOME\\Documents\\WindowsPowerShell<\/li>\n\n\n\n<li>path with 7 is $HOME\\Documents\\PowerShell<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Improved module compatibility<\/li>\n\n\n\n<li>New remoting endpoints<\/li>\n\n\n\n<li>Group policy support<\/li>\n\n\n\n<li>Separate Event logs<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-installation\">Installation<\/h2>\n\n\n\n<p>To install PowerShell 7 on Windows Servers the easiest way is to use a MSI package. The last version to download is the<a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/v7.5.0\/PowerShell-7.5.0-win-x64.msi\"> 7.5.0<\/a>. Once downloaded, double click the msi file and follow the installation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"491\" height=\"382\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\" alt=\"\" class=\"wp-image-36954\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg 491w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1-300x233.jpg 300w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/figure>\n\n\n\n<p>By default and as mentioned previously, PowerShell 7 will be installed on C:\\Program Files\\PowerShell\\ :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"489\" height=\"385\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install2.jpg\" alt=\"\" class=\"wp-image-36957\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install2.jpg 489w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install2-300x236.jpg 300w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/figure>\n\n\n\n<p>Some customization are possible, we will keep the default selections:<br><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"383\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install3.jpg\" alt=\"\" class=\"wp-image-36959\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install3.jpg 492w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install3-300x234.jpg 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p>Starting with PowerShell 7.2, it is possible to update PowerShell 7 with traditional Microsoft Update:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"386\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install4.jpg\" alt=\"\" class=\"wp-image-36961\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install4.jpg 490w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install4-300x236.jpg 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<p>After some seconds installation is done:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"489\" height=\"385\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install7.jpg\" alt=\"\" class=\"wp-image-36965\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install7.jpg 489w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install7-300x236.jpg 300w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/figure>\n\n\n\n<p>We can start the PowerShell 7 with the cmd pwsh.exe. As we can see below both versions coexist on my Windows Server:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"619\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install8.jpg\" alt=\"\" class=\"wp-image-36966\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install8.jpg 686w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install8-300x271.jpg 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-new-features\">New features<\/h2>\n\n\n\n<p>PowerShell 7 introduces some interesting new features compare to PowerShell 5.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-70?view=powershell-7.3#parallel-execution-added-to-foreach-object\">ForEach-Object with parallel execution<\/a><br>Execute the script block in parallel for each object. A parameter ThrottleLimit limits the number of script blocks running at the same time, default value is 5.<br>Here we search the instance properties by server and limit the parallelization to 2 server at the same time.<br>$computers = &#8216;thor90&#8242;,&#8217;thor91&#8242;,&#8217;thor10&#8242;,&#8217;thor11&#8217;<br>$InstanceProperties = $computers | ForEach-Object -Parallel {<br>$instances = (Find-DbaInstance -ComputerName $_).SqlInstance;<br>Get-DbaInstanceProperty -SqlInstance $instances<br>} -ThrottleLimit 2<br><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-70?view=powershell-7.3#ternary-operator\">Ternary operator<\/a><br>A simplified if-else statement with &lt;condition&gt; ? &lt;condition true&gt; : &lt;condition false&gt;<br><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-70?view=powershell-7.3#pipeline-chain-operators\">Pipeline chain operators<\/a><br>The &amp;&amp; operator executes the right-hand pipeline, if the left-hand pipeline succeeded. Reverse, the || operator executes the right-hand pipeline if the left-hand pipeline failed.<br><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-70?view=powershell-7.3#null-coalescing-assignment-and-conditional-operators\">coalescence, assignment and conditional operators<\/a><br>PowerShell 7 includes Null coalescing operator ??, Null conditional assignment ??=, and Null conditional member access operators ?. and ?[]<br><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-70?view=powershell-7.3#new-view-conciseview-and-cmdlet-get-error\">New management of error message and new cmdlet Get-Error<\/a><br>This new cmdlet Get-Error displays the full detailed of the last error with inner exceptions.<br>A parameter Newest allows to select the number of error you would like to display<\/li>\n<\/ul>\n\n\n\n<p>On this blog, post I would to concentrate to the parallelization with the ForEach-Object -Parallel<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-powershell-7-parallelization\">PowerShell 7 parallelization<\/h2>\n\n\n\n<p>This new feature comes with the know ForEach-Object cmdlet which performs an operation on each item in a collection of input objects.<br>Starting with PowerShell 7.0 a new parameter set, called &#8220;Parallel&#8221;, gives the possibility to run each script block in parallel instead of sequentially. The &#8220;ThrottleLimit&#8221; parameter, if used, limits the number of script blocks which will run at the same time, if it is not specified the default value is 5.<\/p>\n\n\n\n<p> ForEach-Object -Parallel &lt;scriptblock&gt; -ThrottleLimit<\/p>\n\n\n\n<p>We can test this new feature with a small example.<br>If we execute the following script as before, the script block is executed sequentially:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\Users\\administrator.ADSTS&gt; 1..16 | ForEach-Object { Get-Date; sleep 10 }\n\nFriday, February 14, 2025 9:00:02 AM\nFriday, February 14, 2025 9:00:12 AM\nFriday, February 14, 2025 9:00:22 AM\nFriday, February 14, 2025 9:00:32 AM\nFriday, February 14, 2025 9:00:42 AM\nFriday, February 14, 2025 9:00:52 AM\nFriday, February 14, 2025 9:01:02 AM\nFriday, February 14, 2025 9:01:12 AM\nFriday, February 14, 2025 9:01:22 AM\nFriday, February 14, 2025 9:01:32 AM\nFriday, February 14, 2025 9:01:42 AM\nFriday, February 14, 2025 9:01:52 AM\nFriday, February 14, 2025 9:02:02 AM\nFriday, February 14, 2025 9:02:12 AM\nFriday, February 14, 2025 9:02:22 AM\nFriday, February 14, 2025 9:02:32 AM<\/code><\/pre>\n\n\n\n<p>Each line as 10 seconds more than the previous one.<br>But, if we execute this script with the new parameter Parallel and use a throttle limit of 4 we have:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\Users\\administrator.ADSTS&gt; 1..16 | ForEach-Object -Parallel { Get-Date; sleep 10 } -ThrottleLimit 4\n\nFriday, February 14, 2025 8:59:01 AM\nFriday, February 14, 2025 8:59:01 AM\nFriday, February 14, 2025 8:59:01 AM\nFriday, February 14, 2025 8:59:01 AM\nFriday, February 14, 2025 8:59:11 AM\nFriday, February 14, 2025 8:59:11 AM\nFriday, February 14, 2025 8:59:11 AM\nFriday, February 14, 2025 8:59:11 AM\nFriday, February 14, 2025 8:59:21 AM\nFriday, February 14, 2025 8:59:21 AM\nFriday, February 14, 2025 8:59:21 AM\nFriday, February 14, 2025 8:59:21 AM\nFriday, February 14, 2025 8:59:31 AM\nFriday, February 14, 2025 8:59:31 AM\nFriday, February 14, 2025 8:59:31 AM\nFriday, February 14, 2025 8:59:31 AM<\/code><\/pre>\n\n\n\n<p>Here we have 4 groups of 4 lines with the same time as we executed the script block in parallel with limitation of the parallelization to 4.<br>Of course, the different commands included in the script block are executed sequentially.<\/p>\n\n\n\n<p>This feature uses the PowerShell runspaces to execute script blocks in parallel.<br>Variables can be passed into the script block with the $using: keyword, the only variable automatically passed is the pipe object.<br>Each runspace will execute a script block in a thread, so the ThrottleLimit parameter needs to be set according to the number of core of the server where you are running. If you VM has 2 cores, it makes no sense to put the limit to 4&#8230;<\/p>\n\n\n\n<p>This new script will execute a maintenance job on different instances of the same server, passing the job name in the block script with the $using: keyword:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\Users\\administrator.ADSTS&gt; $ThrottleLimit = 2\nPS C:\\Users\\administrator.ADSTS&gt; $JobName = 'DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES'\nPS C:\\Users\\administrator.ADSTS&gt; $computers = 'thor90'\nPS C:\\Users\\administrator.ADSTS&gt; $SqlInstances = Find-DbaInstance -ComputerName $computers -EnableException\nPS C:\\Users\\administrator.ADSTS&gt; $SqlInstances\n\nComputerName InstanceName SqlInstance    Port  Availability Confidence ScanTypes\n------------ ------------ -----------    ----  ------------ ---------- ---------\nthor90       CMS          thor90\\CMS     50074 Available    High       Default\nthor90       SQL16_1      thor90\\SQL16_1 62919 Available    High       Default\nthor90       SQL19_1      thor90\\SQL19_1 1433  Available    High       Default\nthor90       SQL22_1      thor90\\SQL22_1 50210 Available    High       Default\nthor90       MSSQLSERVER  thor90         1434  Available    High       Default\n\nPS C:\\Users\\administrator.ADSTS&gt; $SqlInstances | ForEach-Object -Parallel {\n&gt;&gt;     $Out = \"Starting Job on $using:JobName &#091;\" + $_.SqlInstance + \"]\"\n&gt;&gt;     Write-Host $Out\n&gt;&gt;     $res = Start-DbaAgentJob -SqlInstance $_.SqlInstance -Job $using:JobName -Wait\n&gt;&gt; } -ThrottleLimit $ThrottleLimit\nStarting Job on DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES &#091;thor90\\CMS]\nStarting Job on DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES &#091;thor90\\SQL16_1]\nStarting Job on DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES &#091;thor90\\SQL19_1]\nStarting Job on DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES &#091;thor90\\SQL22_1]\nStarting Job on DBI_MAINTENANCE_MAINTENANCE_USER_DATABASES &#091;thor90]\nPS C:\\Users\\administrator.ADSTS&gt;<\/code><\/pre>\n\n\n\n<p>We use this kind of script at a customer place to execute SQL Server Agent Jobs in parallel on instances of a big physical servers with more than 10 instances.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>This PowerShell 7 parallelization feature can improve performance in lots of different scenarios. But test it and don&#8217;t think that because of parallelization all your scripts will be executed quickly as running a script in parallel adds some overhead which will decrease execution of trivial script.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the time being Windows PowerShell 5.1 is installed with Windows Server. It means that if you want to use or even test PowerShell 7 you need to install it by your own.To be honest, even if I&#8217;m using PowerShell as a DBA more or less every day, I did not take too much care [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198,368,2451,99],"tags":[3533,272,51],"type_dbi":[],"class_list":["post-36946","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","category-development-performance","category-ms-teams","category-sql-server","tag-parallelization","tag-powershell","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Starting with PowerShell 7 and parallelization - dbi Blog<\/title>\n<meta name=\"description\" content=\"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Starting with PowerShell 7 and parallelization\" \/>\n<meta property=\"og:description\" content=\"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-26T08:49:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-26T08:49:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"491\" \/>\n\t<meta property=\"og:image:height\" content=\"382\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Savorgnano\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Savorgnano\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\"},\"author\":{\"name\":\"St\u00e9phane Savorgnano\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c\"},\"headline\":\"Starting with PowerShell 7 and parallelization\",\"datePublished\":\"2025-02-26T08:49:14+00:00\",\"dateModified\":\"2025-02-26T08:49:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\"},\"wordCount\":836,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\",\"keywords\":[\"Parallelization\",\"PowerShell\",\"SQL Server\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\",\"Development &amp; Performance\",\"MS Teams\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\",\"name\":\"Starting with PowerShell 7 and parallelization - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\",\"datePublished\":\"2025-02-26T08:49:14+00:00\",\"dateModified\":\"2025-02-26T08:49:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c\"},\"description\":\"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg\",\"width\":491,\"height\":382},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Starting with PowerShell 7 and parallelization\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c\",\"name\":\"St\u00e9phane Savorgnano\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g\",\"caption\":\"St\u00e9phane Savorgnano\"},\"description\":\"St\u00e9phane Savorgnano has more than fifteen years of experience in Microsoft software development and in SQL Server database solutions. He is specialized in SQL Server installation, performance analysis, best practices, etc. St\u00e9phane Savorgnano is Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. Prior to joining dbi services, he was software engineer at Ciba Specialty Chemicals in Basel. St\u00e9phane Savorgnano holds a Master of Informatics from Mulhouse University (F). His branch-related experience covers Banking \/ Financial Services, Chemicals &amp; Pharmaceuticals, etc.\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/stephane-savorgnano\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Starting with PowerShell 7 and parallelization - dbi Blog","description":"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/","og_locale":"en_US","og_type":"article","og_title":"Starting with PowerShell 7 and parallelization","og_description":"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance","og_url":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/","og_site_name":"dbi Blog","article_published_time":"2025-02-26T08:49:14+00:00","article_modified_time":"2025-02-26T08:49:16+00:00","og_image":[{"width":491,"height":382,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg","type":"image\/jpeg"}],"author":"St\u00e9phane Savorgnano","twitter_card":"summary_large_image","twitter_misc":{"Written by":"St\u00e9phane Savorgnano","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/"},"author":{"name":"St\u00e9phane Savorgnano","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c"},"headline":"Starting with PowerShell 7 and parallelization","datePublished":"2025-02-26T08:49:14+00:00","dateModified":"2025-02-26T08:49:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/"},"wordCount":836,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg","keywords":["Parallelization","PowerShell","SQL Server"],"articleSection":["Database Administration &amp; Monitoring","Database management","Development &amp; Performance","MS Teams","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/","url":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/","name":"Starting with PowerShell 7 and parallelization - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg","datePublished":"2025-02-26T08:49:14+00:00","dateModified":"2025-02-26T08:49:16+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c"},"description":"PowerShell 7 add the new parallelization feature to the command foreach-object to improve performance","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2025\/01\/PS7_install1.jpg","width":491,"height":382},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/starting-with-powershell-7-and-parallelization\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Starting with PowerShell 7 and parallelization"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/b6bce7d75118b35bdb3b439ad6a9ca3c","name":"St\u00e9phane Savorgnano","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/88d2a790f775c52c1012ec644d883431da758f2cbcfc16067ade04d2ef625ef5?s=96&d=mm&r=g","caption":"St\u00e9phane Savorgnano"},"description":"St\u00e9phane Savorgnano has more than fifteen years of experience in Microsoft software development and in SQL Server database solutions. He is specialized in SQL Server installation, performance analysis, best practices, etc. St\u00e9phane Savorgnano is Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. Prior to joining dbi services, he was software engineer at Ciba Specialty Chemicals in Basel. St\u00e9phane Savorgnano holds a Master of Informatics from Mulhouse University (F). His branch-related experience covers Banking \/ Financial Services, Chemicals &amp; Pharmaceuticals, etc.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-savorgnano\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=36946"}],"version-history":[{"count":5,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36946\/revisions"}],"predecessor-version":[{"id":37195,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/36946\/revisions\/37195"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=36946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=36946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=36946"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=36946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}