diff --git a/build/update-docs.ps1 b/build/update-docs.ps1 index 08e86f70..109d0338 100644 --- a/build/update-docs.ps1 +++ b/build/update-docs.ps1 @@ -5,7 +5,7 @@ $path = "$PSScriptRoot\.." Import-Module "$path\d365fo.tools" -Force -Remove-Item -Path "$path\docs\*.md" +Remove-Item -Path "$path\docs\*.md" -Exclude "AGENTS.md" $null = New-MarkdownHelp -Module d365fo.tools -OutputFolder "$path\docs" -Force -Get-ChildItem -Path "$path\docs" -Recurse -File | Set-PSMDEncoding \ No newline at end of file +Get-ChildItem -Path "$path\docs" -Recurse -File -Exclude "AGENTS.md" | Set-PSMDEncoding \ No newline at end of file diff --git a/build/vsts-prerequisites.ps1 b/build/vsts-prerequisites.ps1 index 22502d43..8254c605 100644 --- a/build/vsts-prerequisites.ps1 +++ b/build/vsts-prerequisites.ps1 @@ -2,7 +2,7 @@ Write-Host "The user running is: $($env:UserName)" # $modules = @("PSFramework", "Az.Storage", "AzureAd", "PSNotification", "PSOAuthHelper", "PowerShellGet", "PackageManagement","ImportExcel","PSScriptAnalyzer") -$modules = @("PSFramework", "PSScriptAnalyzer", "Az.Storage", "PSOAuthHelper", "ImportExcel") +$modules = @("PSFramework", "PSScriptAnalyzer", "Az.Storage", "PSOAuthHelper", "ImportExcel", "PSModuleDevelopment", "platyPS") Write-Host "Installing Pester, maximum version 4.99.99" -ForegroundColor Cyan Install-Module "Pester" -MaximumVersion 4.99.99 -Force -Confirm:$false -Scope CurrentUser -AllowClobber -SkipPublisherCheck diff --git a/d365fo.tools/functions/get-d365environment.ps1 b/d365fo.tools/functions/get-d365environment.ps1 index 2f166462..d2b93aca 100644 --- a/d365fo.tools/functions/get-d365environment.ps1 +++ b/d365fo.tools/functions/get-d365environment.ps1 @@ -17,6 +17,7 @@ Batch Financial Reporter DMF + DocumentRouting .PARAMETER Aos Instruct the cmdlet to query the AOS (IIS) service @@ -29,6 +30,9 @@ .PARAMETER DMF Instruct the cmdlet query the DMF service + + .PARAMETER DocumentRouting + Instruct the cmdlet query the document routing service .PARAMETER OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled @@ -67,6 +71,11 @@ Will query the FinancialReporter & DMF services on the machine. + .EXAMPLE + PS C:\> Get-D365Environment -DocumentRouting + + Will query the DocumentRouting service on the machine. + .EXAMPLE PS C:\> Get-D365Environment -OutputServiceDetailsOnly @@ -108,6 +117,9 @@ function Get-D365Environment { [Parameter(Mandatory = $false, ParameterSetName = 'Specific')] [switch] $DMF, + [Parameter(Mandatory = $false, ParameterSetName = 'Specific')] + [switch] $DocumentRouting, + [switch] $OnlyStartTypeAutomatic, [switch] $OutputServiceDetailsOnly @@ -117,7 +129,7 @@ function Get-D365Environment { $All = $false } - if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF))) { + if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF)) -and (-not ($DocumentRouting))) { Write-PSFMessage -Level Host -Message "You have to use at least one switch when running this cmdlet. Please run the cmdlet again." Stop-PSFFunction -Message "Stopping because of missing parameters" return diff --git a/d365fo.tools/functions/restart-d365environment.ps1 b/d365fo.tools/functions/restart-d365environment.ps1 index e1f18d64..fce37ff5 100644 --- a/d365fo.tools/functions/restart-d365environment.ps1 +++ b/d365fo.tools/functions/restart-d365environment.ps1 @@ -17,6 +17,7 @@ Batch Financial Reporter DMF + DocumentRouting .PARAMETER Aos Instructs the cmdlet to work against the AOS (IIS) service @@ -29,6 +30,9 @@ .PARAMETER DMF Instructs the cmdlet to work against the DMF service + + .PARAMETER DocumentRouting + Instructs the cmdlet to work against the Document Routing service .PARAMETER Kill Instructs the cmdlet to kill the service(s) that you want to restart @@ -66,6 +70,11 @@ This will stop the FinancialReporter and DMF services and then start the FinancialReporter and DMF services again. + .EXAMPLE + PS C:\> Restart-D365Environment -DocumentRouting + + This will stop the DocumentRouting service and then start the DocumentRouting service again. + .EXAMPLE PS C:\> Restart-D365Environment -All -Kill @@ -103,6 +112,9 @@ function Restart-D365Environment { [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 5 )] [switch] $DMF, + [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 6 )] + [switch] $DocumentRouting, + [switch] $Kill, [Parameter(Mandatory = $False)] diff --git a/d365fo.tools/functions/start-d365environment.ps1 b/d365fo.tools/functions/start-d365environment.ps1 index 171639f2..23838d4f 100644 --- a/d365fo.tools/functions/start-d365environment.ps1 +++ b/d365fo.tools/functions/start-d365environment.ps1 @@ -16,6 +16,8 @@ Aos Batch Financial Reporter + DMF + DocumentRouting .PARAMETER Aos Start the Aos (iis) service @@ -28,6 +30,9 @@ .PARAMETER DMF Start the Data Management Framework service + + .PARAMETER DocumentRouting + Start the Document Routing service .PARAMETER OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled @@ -73,6 +78,11 @@ This will start the FinancialReporter and DMF services on the machine. + .EXAMPLE + PS C:\> Start-D365Environment -DocumentRouting + + This will start the DocumentRouting service on the machine. + .NOTES Author: Mötz Jensen (@Splaxi) @@ -102,6 +112,9 @@ function Start-D365Environment { [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 5 )] [switch] $DMF, + [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 6 )] + [switch] $DocumentRouting, + [switch] $OnlyStartTypeAutomatic, [switch] $ShowOriginalProgress @@ -113,7 +126,7 @@ function Start-D365Environment { $All = $false } - if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF))) { + if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF)) -and (-not ($DocumentRouting))) { Write-PSFMessage -Level Host -Message "You have to use at least one switch when running this cmdlet. Please run the cmdlet again." Stop-PSFFunction -Message "Stopping because of missing parameters" return diff --git a/d365fo.tools/functions/start-d365environmentv2.ps1 b/d365fo.tools/functions/start-d365environmentv2.ps1 index 4b61d801..6a0e1df4 100644 --- a/d365fo.tools/functions/start-d365environmentv2.ps1 +++ b/d365fo.tools/functions/start-d365environmentv2.ps1 @@ -26,6 +26,9 @@ .PARAMETER DMF Start the Data Management Framework service + + .PARAMETER DocumentRouting + Start the Document Routing service .PARAMETER OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled @@ -71,6 +74,11 @@ This will start the FinancialReporter and DMF services on the machine. + .EXAMPLE + PS C:\> Start-D365EnvironmentV2 -DocumentRouting + + This will start the DocumentRouting service on the machine. + .EXAMPLE PS C:\> Enable-D365Exception PS C:\> Start-D365EnvironmentV2 @@ -105,6 +113,9 @@ function Start-D365EnvironmentV2 { [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 4 )] [switch] $DMF, + [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 5 )] + [switch] $DocumentRouting, + [switch] $OnlyStartTypeAutomatic, [switch] $ShowOriginalProgress @@ -116,7 +127,7 @@ function Start-D365EnvironmentV2 { $All = $false } - if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF))) { + if ( (-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF)) -and (-not ($DocumentRouting))) { Write-PSFMessage -Level Host -Message "You have to use at least one switch when running this cmdlet. Please run the cmdlet again." Stop-PSFFunction -Message "Stopping because of missing parameters" return diff --git a/d365fo.tools/functions/stop-d365environment.ps1 b/d365fo.tools/functions/stop-d365environment.ps1 index a7083141..512df94f 100644 --- a/d365fo.tools/functions/stop-d365environment.ps1 +++ b/d365fo.tools/functions/stop-d365environment.ps1 @@ -16,6 +16,8 @@ Aos Batch Financial Reporter + DMF + DocumentRouting .PARAMETER Aos Stop the Aos (iis) service @@ -28,6 +30,9 @@ .PARAMETER DMF Start the Data Management Framework service + + .PARAMETER DocumentRouting + Stop the Document Routing service .PARAMETER Kill Instructs the cmdlet to kill the service(s) that you want to stop @@ -67,6 +72,11 @@ This will stop the FinancialReporter and DMF services on the machine. + .EXAMPLE + PS C:\> Stop-D365Environment -DocumentRouting + + This will stop the DocumentRouting service on the machine. + .EXAMPLE PS C:\> Stop-D365Environment -All -Kill @@ -103,11 +113,14 @@ function Stop-D365Environment { [switch] $DMF, [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 6 )] - [Parameter(Mandatory = $false, ParameterSetName = 'Default', Position = 6 )] - [switch] $Kill, + [switch] $DocumentRouting, [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 7 )] [Parameter(Mandatory = $false, ParameterSetName = 'Default', Position = 7 )] + [switch] $Kill, + + [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 8 )] + [Parameter(Mandatory = $false, ParameterSetName = 'Default', Position = 8 )] [switch] $ShowOriginalProgress ) @@ -115,7 +128,7 @@ function Stop-D365Environment { $All = $false } - if ((-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF))) { + if ((-not ($All)) -and (-not ($Aos)) -and (-not ($Batch)) -and (-not ($FinancialReporter)) -and (-not ($DMF)) -and (-not ($DocumentRouting))) { Write-PSFMessage -Level Host -Message "You have to use at least one switch when running this cmdlet. Please run the cmdlet again." Stop-PSFFunction -Message "Stopping because of missing parameters" return diff --git a/d365fo.tools/internal/functions/get-servicelist.ps1 b/d365fo.tools/internal/functions/get-servicelist.ps1 index 3ff7a7f3..3f6e88fe 100644 --- a/d365fo.tools/internal/functions/get-servicelist.ps1 +++ b/d365fo.tools/internal/functions/get-servicelist.ps1 @@ -20,6 +20,9 @@ .PARAMETER DMF Switch to instruct the cmdlet to output the data management service name + + .PARAMETER DocumentRouting + Switch to instruct the cmdlet to output the document routing service name .EXAMPLE PS C:\> Get-ServiceList -All @@ -48,7 +51,10 @@ Function Get-ServiceList { [switch] $FinancialReporter, [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 5 )] - [switch] $DMF + [switch] $DMF, + + [Parameter(Mandatory = $false, ParameterSetName = 'Specific', Position = 6 )] + [switch] $DocumentRouting ) if ($PSCmdlet.ParameterSetName -eq "Specific") { @@ -61,11 +67,12 @@ Function Get-ServiceList { $batchname = "DynamicsAxBatch" $financialname = "MR2012ProcessService" $dmfname = "Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe" + $documentroutingname = "DocumentRoutingService" [System.Collections.ArrayList]$Services = New-Object -TypeName "System.Collections.ArrayList" if ($All) { - $null = $Services.AddRange(@($aosname, $batchname, $financialname, $dmfname)) + $null = $Services.AddRange(@($aosname, $batchname, $financialname, $dmfname, $documentroutingname)) } else { if ($Aos) { @@ -80,6 +87,9 @@ Function Get-ServiceList { if ($DMF) { $null = $Services.Add($dmfname) } + if ($DocumentRouting) { + $null = $Services.Add($documentroutingname) + } } $Services.ToArray() diff --git a/d365fo.tools/tests/functions/AGENTS.md b/d365fo.tools/tests/functions/AGENTS.md new file mode 100644 index 00000000..1ebfe5a0 --- /dev/null +++ b/d365fo.tools/tests/functions/AGENTS.md @@ -0,0 +1,13 @@ +# Unit Tests for Public Functions + +Do not hand-edit `*.Tests.ps1` files here. They are generated. + +To generate / update all parameter unit tests after adding or changing a public function, run from the repo root with PowerShell 5: + +```powershell +pwsh -NoProfile -File ./build/generate-parameterunittests.ps1 +``` + +The script takes no parameters. It deletes and regenerates every `*.Tests.ps1` file in this folder, so always run it after a parameter signature change and include the full regeneration in your commit. + +Requires `PSModuleDevelopment` (`Invoke-PSMDTemplate`). Install prerequisites with `build/vsts-prerequisites.ps1` if the template command is missing. diff --git a/d365fo.tools/tests/functions/Get-D365Environment.Tests.ps1 b/d365fo.tools/tests/functions/Get-D365Environment.Tests.ps1 index edd88199..24e42afd 100644 --- a/d365fo.tools/tests/functions/Get-D365Environment.Tests.ps1 +++ b/d365fo.tools/tests/functions/Get-D365Environment.Tests.ps1 @@ -95,6 +95,19 @@ $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter DocumentRouting' { + $parameter = (Get-Command Get-D365Environment).Parameters['DocumentRouting'] + $parameter.Name | Should -Be 'DocumentRouting' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be 'Specific' + $parameter.ParameterSets.Keys | Should -Contain 'Specific' + $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False + $parameter.ParameterSets['Specific'].Position | Should -Be -2147483648 + $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False + } It 'Should have the expected parameter OnlyStartTypeAutomatic' { $parameter = (Get-Command Get-D365Environment).Parameters['OnlyStartTypeAutomatic'] $parameter.Name | Should -Be 'OnlyStartTypeAutomatic' @@ -132,7 +145,7 @@ Describe "Testing parameterset Specific" { <# Specific - - Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -OnlyStartTypeAutomatic -OutputServiceDetailsOnly + Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -DocumentRouting -OnlyStartTypeAutomatic -OutputServiceDetailsOnly #> } diff --git a/d365fo.tools/tests/functions/Invoke-D365ModuleBuild.Tests.ps1 b/d365fo.tools/tests/functions/Invoke-D365ModuleBuild.Tests.ps1 index bfd89e32..bdf38268 100644 --- a/d365fo.tools/tests/functions/Invoke-D365ModuleBuild.Tests.ps1 +++ b/d365fo.tools/tests/functions/Invoke-D365ModuleBuild.Tests.ps1 @@ -1,4 +1,4 @@ -Describe "Invoke-D365ModuleBuild Unit Tests" -Tag "Unit" { +Describe "Invoke-D365ModuleBuild Unit Tests" -Tag "Unit" { BeforeAll { # Place here all things needed to prepare for the tests } @@ -146,7 +146,7 @@ Describe "Invoke-D365ModuleBuild Unit Tests" -Tag "Unit" { Describe "Testing parameterset __AllParameterSets" { <# __AllParameterSets -Module - __AllParameterSets -Module -OutputDir -LogPath -MetaDataDir -ReferenceDir -BinDir -IncludeReports -ShowOriginalProgress -OutputCommandOnly -Verbosity -Verbosity + __AllParameterSets -Module -OutputDir -LogPath -MetaDataDir -ReferenceDir -BinDir -IncludeReports -ShowOriginalProgress -OutputCommandOnly -Verbosity #> } diff --git a/d365fo.tools/tests/functions/Restart-D365Environment.Tests.ps1 b/d365fo.tools/tests/functions/Restart-D365Environment.Tests.ps1 index dfd74100..5a08486b 100644 --- a/d365fo.tools/tests/functions/Restart-D365Environment.Tests.ps1 +++ b/d365fo.tools/tests/functions/Restart-D365Environment.Tests.ps1 @@ -95,6 +95,19 @@ $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter DocumentRouting' { + $parameter = (Get-Command Restart-D365Environment).Parameters['DocumentRouting'] + $parameter.Name | Should -Be 'DocumentRouting' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be 'Specific' + $parameter.ParameterSets.Keys | Should -Contain 'Specific' + $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False + $parameter.ParameterSets['Specific'].Position | Should -Be 6 + $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False + } It 'Should have the expected parameter Kill' { $parameter = (Get-Command Restart-D365Environment).Parameters['Kill'] $parameter.Name | Should -Be 'Kill' @@ -132,7 +145,7 @@ Describe "Testing parameterset Specific" { <# Specific - - Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -Kill -ShowOriginalProgress + Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -DocumentRouting -Kill -ShowOriginalProgress #> } diff --git a/d365fo.tools/tests/functions/Start-D365Environment.Tests.ps1 b/d365fo.tools/tests/functions/Start-D365Environment.Tests.ps1 index 7cbe2f88..5240ac02 100644 --- a/d365fo.tools/tests/functions/Start-D365Environment.Tests.ps1 +++ b/d365fo.tools/tests/functions/Start-D365Environment.Tests.ps1 @@ -95,6 +95,19 @@ $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter DocumentRouting' { + $parameter = (Get-Command Start-D365Environment).Parameters['DocumentRouting'] + $parameter.Name | Should -Be 'DocumentRouting' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be 'Specific' + $parameter.ParameterSets.Keys | Should -Contain 'Specific' + $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False + $parameter.ParameterSets['Specific'].Position | Should -Be 6 + $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False + } It 'Should have the expected parameter OnlyStartTypeAutomatic' { $parameter = (Get-Command Start-D365Environment).Parameters['OnlyStartTypeAutomatic'] $parameter.Name | Should -Be 'OnlyStartTypeAutomatic' @@ -132,7 +145,7 @@ Describe "Testing parameterset Specific" { <# Specific - - Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -OnlyStartTypeAutomatic -ShowOriginalProgress + Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -DocumentRouting -OnlyStartTypeAutomatic -ShowOriginalProgress #> } diff --git a/d365fo.tools/tests/functions/Start-D365EnvironmentV2.Tests.ps1 b/d365fo.tools/tests/functions/Start-D365EnvironmentV2.Tests.ps1 index b23bc023..f84600ab 100644 --- a/d365fo.tools/tests/functions/Start-D365EnvironmentV2.Tests.ps1 +++ b/d365fo.tools/tests/functions/Start-D365EnvironmentV2.Tests.ps1 @@ -76,6 +76,19 @@ $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter DocumentRouting' { + $parameter = (Get-Command Start-D365EnvironmentV2).Parameters['DocumentRouting'] + $parameter.Name | Should -Be 'DocumentRouting' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be 'Specific' + $parameter.ParameterSets.Keys | Should -Contain 'Specific' + $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False + $parameter.ParameterSets['Specific'].Position | Should -Be 5 + $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False + } It 'Should have the expected parameter OnlyStartTypeAutomatic' { $parameter = (Get-Command Start-D365EnvironmentV2).Parameters['OnlyStartTypeAutomatic'] $parameter.Name | Should -Be 'OnlyStartTypeAutomatic' @@ -113,7 +126,7 @@ Describe "Testing parameterset Specific" { <# Specific - - Specific -Aos -Batch -FinancialReporter -DMF -OnlyStartTypeAutomatic -ShowOriginalProgress + Specific -Aos -Batch -FinancialReporter -DMF -DocumentRouting -OnlyStartTypeAutomatic -ShowOriginalProgress #> } diff --git a/d365fo.tools/tests/functions/Stop-D365Environment.Tests.ps1 b/d365fo.tools/tests/functions/Stop-D365Environment.Tests.ps1 index 44cf0569..d496c1d6 100644 --- a/d365fo.tools/tests/functions/Stop-D365Environment.Tests.ps1 +++ b/d365fo.tools/tests/functions/Stop-D365Environment.Tests.ps1 @@ -95,6 +95,19 @@ $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter DocumentRouting' { + $parameter = (Get-Command Stop-D365Environment).Parameters['DocumentRouting'] + $parameter.Name | Should -Be 'DocumentRouting' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be 'Specific' + $parameter.ParameterSets.Keys | Should -Contain 'Specific' + $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False + $parameter.ParameterSets['Specific'].Position | Should -Be 6 + $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False + } It 'Should have the expected parameter Kill' { $parameter = (Get-Command Stop-D365Environment).Parameters['Kill'] $parameter.Name | Should -Be 'Kill' @@ -103,13 +116,13 @@ $parameter.ParameterSets.Keys | Should -Be 'Default', 'Specific' $parameter.ParameterSets.Keys | Should -Contain 'Default' $parameter.ParameterSets['Default'].IsMandatory | Should -Be $False - $parameter.ParameterSets['Default'].Position | Should -Be 6 + $parameter.ParameterSets['Default'].Position | Should -Be 7 $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False $parameter.ParameterSets.Keys | Should -Contain 'Specific' $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False - $parameter.ParameterSets['Specific'].Position | Should -Be 6 + $parameter.ParameterSets['Specific'].Position | Should -Be 7 $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False @@ -122,13 +135,13 @@ $parameter.ParameterSets.Keys | Should -Be 'Default', 'Specific' $parameter.ParameterSets.Keys | Should -Contain 'Default' $parameter.ParameterSets['Default'].IsMandatory | Should -Be $False - $parameter.ParameterSets['Default'].Position | Should -Be 7 + $parameter.ParameterSets['Default'].Position | Should -Be 8 $parameter.ParameterSets['Default'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Default'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Default'].ValueFromRemainingArguments | Should -Be $False $parameter.ParameterSets.Keys | Should -Contain 'Specific' $parameter.ParameterSets['Specific'].IsMandatory | Should -Be $False - $parameter.ParameterSets['Specific'].Position | Should -Be 7 + $parameter.ParameterSets['Specific'].Position | Should -Be 8 $parameter.ParameterSets['Specific'].ValueFromPipeline | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['Specific'].ValueFromRemainingArguments | Should -Be $False @@ -144,7 +157,7 @@ Describe "Testing parameterset Specific" { <# Specific - - Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -Kill -ShowOriginalProgress + Specific -ComputerName -Aos -Batch -FinancialReporter -DMF -DocumentRouting -Kill -ShowOriginalProgress #> } diff --git a/docs/AGENTS.md b/docs/AGENTS.md new file mode 100644 index 00000000..be9c0e2d --- /dev/null +++ b/docs/AGENTS.md @@ -0,0 +1,13 @@ +# Module Documentation + +Do not hand-edit `*.md` files here. They are generated. + +To generate / update all markdown help files after adding or changing a public function, run from the repo root with PowerShell 5: + +```powershell +pwsh -NoProfile -File ./build/update-docs.ps1 +``` + +The script takes no parameters. It deletes and regenerates every `*.md` file in this folder, so always run it after a comment-based help change and include the full regeneration in your commit. + +Requires `platyPS` (`New-MarkdownHelp`). Install prerequisites with `build/vsts-prerequisites.ps1` if the help command is missing. diff --git a/docs/Get-D365Environment.md b/docs/Get-D365Environment.md index d0053db8..ded3b824 100644 --- a/docs/Get-D365Environment.md +++ b/docs/Get-D365Environment.md @@ -20,7 +20,7 @@ Get-D365Environment [[-ComputerName] ] [-All] [-OnlyStartTypeAutomatic ### Specific ``` -Get-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] +Get-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] [-DocumentRouting] [-OnlyStartTypeAutomatic] [-OutputServiceDetailsOnly] [] ``` @@ -74,13 +74,20 @@ Will query the FinancialReporter & DMF services on the machine. ### EXAMPLE 7 ``` +Get-D365Environment -DocumentRouting +``` + +Will query the DocumentRouting service on the machine. + +### EXAMPLE 8 +``` Get-D365Environment -OutputServiceDetailsOnly ``` Will query all D365FO service on the machine. Will omit the servername from the output. -### EXAMPLE 8 +### EXAMPLE 9 ``` Get-D365Environment -FinancialReporter | Set-Service -StartupType Manual ``` @@ -112,6 +119,7 @@ Aos Batch Financial Reporter DMF +DocumentRouting ```yaml Type: SwitchParameter @@ -185,6 +193,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DocumentRouting +Instruct the cmdlet query the document routing service + +```yaml +Type: SwitchParameter +Parameter Sets: Specific +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled diff --git a/docs/Get-D365LcsAssetFile.md b/docs/Get-D365LcsAssetFile.md index c28ba6b4..ae0a2085 100644 --- a/docs/Get-D365LcsAssetFile.md +++ b/docs/Get-D365LcsAssetFile.md @@ -164,7 +164,7 @@ Default value is "Software Deployable Package" Type: LcsAssetFileType Parameter Sets: (All) Aliases: -Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension +Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, Backup, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension Required: False Position: 2 diff --git a/docs/Get-D365LcsSharedAssetFile.md b/docs/Get-D365LcsSharedAssetFile.md index 085e3c69..55e1ffd4 100644 --- a/docs/Get-D365LcsSharedAssetFile.md +++ b/docs/Get-D365LcsSharedAssetFile.md @@ -181,7 +181,7 @@ Default value is "Software Deployable Package" Type: LcsAssetFileType Parameter Sets: (All) Aliases: -Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension +Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, Backup, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension Required: False Position: 2 diff --git a/docs/Invoke-D365LcsUpload.md b/docs/Invoke-D365LcsUpload.md index e684b0b2..192c6038 100644 --- a/docs/Invoke-D365LcsUpload.md +++ b/docs/Invoke-D365LcsUpload.md @@ -160,7 +160,7 @@ Default value is "Software Deployable Package" Type: LcsAssetFileType Parameter Sets: (All) Aliases: -Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension +Accepted values: Model, ProcessDataPackage, SoftwareDeployablePackage, GERConfiguration, DataPackage, Backup, PowerBIReportModel, ECommercePackage, NuGetPackage, RetailSelfServicePackage, CommerceCloudScaleUnitExtension Required: False Position: 4 diff --git a/docs/Invoke-D365ModuleBuild.md b/docs/Invoke-D365ModuleBuild.md index bdd7ac2d..2ed104c7 100644 --- a/docs/Invoke-D365ModuleBuild.md +++ b/docs/Invoke-D365ModuleBuild.md @@ -1,4 +1,4 @@ ---- +--- external help file: d365fo.tools-help.xml Module Name: d365fo.tools online version: @@ -15,8 +15,7 @@ Build a package / module (X++ compile + labels, reports optional) ``` Invoke-D365ModuleBuild [-Module] [[-OutputDir] ] [[-LogPath] ] [[-MetaDataDir] ] [[-ReferenceDir] ] [[-BinDir] ] [-IncludeReports] - [-ShowOriginalProgress] [-OutputCommandOnly] [[-Verbosity] ] [-ProgressAction ] - [] + [-ShowOriginalProgress] [-OutputCommandOnly] [[-Verbosity] ] [] ``` ## DESCRIPTION @@ -222,21 +221,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ProgressAction -{{ Fill ProgressAction Description }} - -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: proga - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Restart-D365Environment.md b/docs/Restart-D365Environment.md index 0d0e6e06..f6fe9102 100644 --- a/docs/Restart-D365Environment.md +++ b/docs/Restart-D365Environment.md @@ -20,8 +20,8 @@ Restart-D365Environment [[-ComputerName] ] [-All] [-Kill] [-ShowOrigin ### Specific ``` -Restart-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] [-Kill] - [-ShowOriginalProgress] [] +Restart-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] + [-DocumentRouting] [-Kill] [-ShowOriginalProgress] [] ``` ## DESCRIPTION @@ -69,6 +69,13 @@ This will stop the FinancialReporter and DMF services and then start the Financi ### EXAMPLE 6 ``` +Restart-D365Environment -DocumentRouting +``` + +This will stop the DocumentRouting service and then start the DocumentRouting service again. + +### EXAMPLE 7 +``` Restart-D365Environment -All -Kill ``` @@ -100,6 +107,7 @@ Aos Batch Financial Reporter DMF +DocumentRouting ```yaml Type: SwitchParameter @@ -173,6 +181,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DocumentRouting +Instructs the cmdlet to work against the Document Routing service + +```yaml +Type: SwitchParameter +Parameter Sets: Specific +Aliases: + +Required: False +Position: 7 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Kill Instructs the cmdlet to kill the service(s) that you want to restart diff --git a/docs/Start-D365Environment.md b/docs/Start-D365Environment.md index 4bb574ec..d288515d 100644 --- a/docs/Start-D365Environment.md +++ b/docs/Start-D365Environment.md @@ -21,7 +21,7 @@ Start-D365Environment [[-ComputerName] ] [-All] [-OnlyStartTypeAutomat ### Specific ``` Start-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] - [-OnlyStartTypeAutomatic] [-ShowOriginalProgress] [] + [-DocumentRouting] [-OnlyStartTypeAutomatic] [-ShowOriginalProgress] [] ``` ## DESCRIPTION @@ -77,6 +77,13 @@ Start-D365Environment -FinancialReporter -DMF This will start the FinancialReporter and DMF services on the machine. +### EXAMPLE 7 +``` +Start-D365Environment -DocumentRouting +``` + +This will start the DocumentRouting service on the machine. + ## PARAMETERS ### -ComputerName @@ -101,6 +108,8 @@ Includes: Aos Batch Financial Reporter +DMF +DocumentRouting ```yaml Type: SwitchParameter @@ -174,6 +183,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DocumentRouting +Start the Document Routing service + +```yaml +Type: SwitchParameter +Parameter Sets: Specific +Aliases: + +Required: False +Position: 7 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled diff --git a/docs/Start-D365EnvironmentV2.md b/docs/Start-D365EnvironmentV2.md index 84be2f71..72c25d12 100644 --- a/docs/Start-D365EnvironmentV2.md +++ b/docs/Start-D365EnvironmentV2.md @@ -19,8 +19,8 @@ Start-D365EnvironmentV2 [-All] [-OnlyStartTypeAutomatic] [-ShowOriginalProgress] ### Specific ``` -Start-D365EnvironmentV2 [-Aos] [-Batch] [-FinancialReporter] [-DMF] [-OnlyStartTypeAutomatic] - [-ShowOriginalProgress] [] +Start-D365EnvironmentV2 [-Aos] [-Batch] [-FinancialReporter] [-DMF] [-DocumentRouting] + [-OnlyStartTypeAutomatic] [-ShowOriginalProgress] [] ``` ## DESCRIPTION @@ -78,6 +78,13 @@ This will start the FinancialReporter and DMF services on the machine. ### EXAMPLE 7 ``` +Start-D365EnvironmentV2 -DocumentRouting +``` + +This will start the DocumentRouting service on the machine. + +### EXAMPLE 8 +``` Enable-D365Exception ``` @@ -171,6 +178,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DocumentRouting +Start the Document Routing service + +```yaml +Type: SwitchParameter +Parameter Sets: Specific +Aliases: + +Required: False +Position: 6 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -OnlyStartTypeAutomatic Instruct the cmdlet to filter out services that are set to manual start or disabled diff --git a/docs/Stop-D365Environment.md b/docs/Stop-D365Environment.md index 17e07ea9..ce78f3fc 100644 --- a/docs/Stop-D365Environment.md +++ b/docs/Stop-D365Environment.md @@ -19,8 +19,8 @@ Stop-D365Environment [[-ComputerName] ] [-All] [-Kill] [-ShowOriginalP ### Specific ``` -Stop-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] [-Kill] - [-ShowOriginalProgress] [] +Stop-D365Environment [[-ComputerName] ] [-Aos] [-Batch] [-FinancialReporter] [-DMF] + [-DocumentRouting] [-Kill] [-ShowOriginalProgress] [] ``` ## DESCRIPTION @@ -70,6 +70,13 @@ This will stop the FinancialReporter and DMF services on the machine. ### EXAMPLE 6 ``` +Stop-D365Environment -DocumentRouting +``` + +This will stop the DocumentRouting service on the machine. + +### EXAMPLE 7 +``` Stop-D365Environment -All -Kill ``` @@ -100,6 +107,8 @@ Includes: Aos Batch Financial Reporter +DMF +DocumentRouting ```yaml Type: SwitchParameter @@ -173,6 +182,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DocumentRouting +Stop the Document Routing service + +```yaml +Type: SwitchParameter +Parameter Sets: Specific +Aliases: + +Required: False +Position: 7 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Kill Instructs the cmdlet to kill the service(s) that you want to stop @@ -182,7 +206,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 8 Default value: False Accept pipeline input: False Accept wildcard characters: False @@ -199,7 +223,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 9 Default value: False Accept pipeline input: False Accept wildcard characters: False