From e93a7a43aa5bf47b2379637316562f036b056f59 Mon Sep 17 00:00:00 2001 From: ehmiiz Date: Sat, 9 Sep 2023 14:27:20 +0200 Subject: [PATCH 1/2] Fixes formatting for examples --- .../5.1/Microsoft.PowerShell.Core/Connect-PSSession.md | 10 +++++----- .../7.2/Microsoft.PowerShell.Core/Connect-PSSession.md | 10 +++++----- .../7.3/Microsoft.PowerShell.Core/Connect-PSSession.md | 10 +++++----- .../7.4/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md index e8a87b1e56fb..e2dce6e783cc 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 12/02/2022 +ms.date: 09/09/2023 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/connect-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Connect-PSSession @@ -203,7 +203,7 @@ session. The command saves the results in the `$BackupSpecs` variable.The eighth ```powershell $s = New-PSSession -ComputerName Server01 -Name ITTask -ConfigurationName ITTasks -Invoke-Command -Session $s {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} +Invoke-Command -Session $s -ScriptBlock {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} ``` ```Output @@ -243,7 +243,7 @@ Id Name ComputerName State ConfigurationName Availabil ``` ```powershell -Invoke-Command -Session $s {Get-Job} +Invoke-Command -Session $s -ScriptBlock {Get-Job} ``` ```Output @@ -253,8 +253,8 @@ Id Name State HasMoreData Location Comman ``` ```powershell -Invoke-Command -Session $s {$BackupSpecs = Receive-Job -JobName Job2} -Invoke-Command -Session $s {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} +Invoke-Command -Session $s -ScriptBlock {$BackupSpecs = Receive-Job -JobName Job2} +Invoke-Command -Session $s -ScriptBlock {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 ``` diff --git a/reference/7.2/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/7.2/Microsoft.PowerShell.Core/Connect-PSSession.md index fefb7c2834fe..aa5afb016a32 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 12/02/2022 +ms.date: 09/09/2023 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/connect-pssession?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Connect-PSSession @@ -208,7 +208,7 @@ session. The command saves the results in the `$BackupSpecs` variable.The eighth ```powershell $s = New-PSSession -ComputerName Server01 -Name ITTask -ConfigurationName ITTasks -Invoke-Command -Session $s {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} +Invoke-Command -Session $s -ScriptBlock {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} ``` ```Output @@ -248,7 +248,7 @@ Id Name ComputerName State ConfigurationName Availabil ``` ```powershell -Invoke-Command -Session $s {Get-Job} +Invoke-Command -Session $s -ScriptBlock {Get-Job} ``` ```Output @@ -258,8 +258,8 @@ Id Name State HasMoreData Location Comman ``` ```powershell -Invoke-Command -Session $s {$BackupSpecs = Receive-Job -JobName Job2} -Invoke-Command -Session $s {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} +Invoke-Command -Session $s -ScriptBlock {$BackupSpecs = Receive-Job -JobName Job2} +Invoke-Command -Session $s -ScriptBlock {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 ``` diff --git a/reference/7.3/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/7.3/Microsoft.PowerShell.Core/Connect-PSSession.md index d93669b7a04a..b24f1dab88c0 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 12/02/2022 +ms.date: 09/09/2023 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/connect-pssession?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Connect-PSSession @@ -208,7 +208,7 @@ session. The command saves the results in the `$BackupSpecs` variable.The eighth ```powershell $s = New-PSSession -ComputerName Server01 -Name ITTask -ConfigurationName ITTasks -Invoke-Command -Session $s {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} +Invoke-Command -Session $s -ScriptBlock {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} ``` ```Output @@ -248,7 +248,7 @@ Id Name ComputerName State ConfigurationName Availabil ``` ```powershell -Invoke-Command -Session $s {Get-Job} +Invoke-Command -Session $s -ScriptBlock {Get-Job} ``` ```Output @@ -258,8 +258,8 @@ Id Name State HasMoreData Location Comman ``` ```powershell -Invoke-Command -Session $s {$BackupSpecs = Receive-Job -JobName Job2} -Invoke-Command -Session $s {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} +Invoke-Command -Session $s -ScriptBlock {$BackupSpecs = Receive-Job -JobName Job2} +Invoke-Command -Session $s -ScriptBlock {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md index e982a0a6927d..ed8ee5194e1f 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 12/02/2022 +ms.date: 09/09/2023 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/connect-pssession?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Connect-PSSession From 25ea1fcf5d3ee5f3a1dafafffaec81ea572c62ce Mon Sep 17 00:00:00 2001 From: ehmiiz Date: Sat, 9 Sep 2023 14:30:31 +0200 Subject: [PATCH 2/2] Fixes formatting syntax Connect-PSSession 7.4 --- .../7.4/Microsoft.PowerShell.Core/Connect-PSSession.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md index ed8ee5194e1f..2ecf2593406a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -208,7 +208,7 @@ session. The command saves the results in the `$BackupSpecs` variable.The eighth ```powershell $s = New-PSSession -ComputerName Server01 -Name ITTask -ConfigurationName ITTasks -Invoke-Command -Session $s {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} +Invoke-Command -Session $s -ScriptBlock {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} ``` ```Output @@ -248,7 +248,7 @@ Id Name ComputerName State ConfigurationName Availabil ``` ```powershell -Invoke-Command -Session $s {Get-Job} +Invoke-Command -Session $s -ScriptBlock {Get-Job} ``` ```Output @@ -258,8 +258,8 @@ Id Name State HasMoreData Location Comman ``` ```powershell -Invoke-Command -Session $s {$BackupSpecs = Receive-Job -JobName Job2} -Invoke-Command -Session $s {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} +Invoke-Command -Session $s -ScriptBlock {$BackupSpecs = Receive-Job -JobName Job2} +Invoke-Command -Session $s -ScriptBlock {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 ```