Skip to content

Commit

Permalink
🤖 Fix best practice deviations
Browse files Browse the repository at this point in the history
This pull request was automatically created by the d365fo.tools-Generate-Text action'
  • Loading branch information
FH-Inway committed Nov 17, 2024
1 parent 7631e8c commit ad952c0
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 14 deletions.
29 changes: 29 additions & 0 deletions d365fo.tools/bin/d365fo.tools-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9952,6 +9952,35 @@
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003ePublish-D365SsrsReport -Module ApplicationSuite -ReportName TaxVatRegister.Report\nThis will deploy the report which is named \"TaxVatRegister.Report\".\r\nThe cmdlet will look for the report inside the ApplicationSuite module.\r\nThe cmdlet will be using the default 127.0.0.1 while deploying the report.\n-------------------------- EXAMPLE 2 --------------------------\nPS C:\\\u003ePublish-D365SsrsReport -Module ApplicationSuite -ReportName *\nThis will deploy the all reports from the ApplicationSuite module.\r\nThe cmdlet will be using the default 127.0.0.1 while deploying the report.",
"Syntax": "Publish-D365SsrsReport [[-Module] \u003cString[]\u003e] [[-ReportName] \u003cString[]\u003e] [[-LogFile] \u003cString\u003e] [[-PackageDirectory] \u003cString\u003e] [[-ToolsBasePath] \u003cString\u003e] [[-ReportServerIp] \u003cString[]\u003e] [\u003cCommonParameters\u003e]"
},
{
"CommandName": "Publish-D365WebResources",
"Description": "Deploys the Dynamics 365 for Finance and Operations web resources to the AOS service web root path.",
"Params": [
[
"PackageDirectory",
"Path to the package directory containing the web resources.",
"",
false,
"false",
"$Script:PackageDirectory"
],
[
"AosServiceWebRootPath",
"Path to the AOS service web root path.",
"",
false,
"false",
"$Script:AOSPath"
]
],
"Alias": "",
"Author": "Florian Hopfner (@FH-Inway)",
"Synopsis": "Deploy web resources",
"Name": "Publish-D365WebResources",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003ePublish-D365WebResources\nThis will deploy the web resources to the AOS service web root path.",
"Syntax": "Publish-D365WebResources [[-PackageDirectory] \u003cPathDirectoryParameter\u003e] [[-AosServiceWebRootPath] \u003cPathDirectoryParameter\u003e] [\u003cCommonParameters\u003e]"
},
{
"CommandName": "Register-D365AzureStorageConfig",
"Description": "Register all Azure Storage Configurations",
Expand Down
13 changes: 7 additions & 6 deletions d365fo.tools/functions/publish-d365webresources.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

<#
.SYNOPSIS
Deploy web resources
.DESCRIPTION
Deploys the Dynamics 365 for Finance and Operations web resources to the AOS service web root path.
.PARAMETER PackageDirectory
Path to the package directory containing the web resources.
.PARAMETER AosServiceWebRootPath
Path to the AOS service web root path.
.EXAMPLE
PS C:\> Publish-D365WebResources
This will deploy the web resources to the AOS service web root path.
.NOTES
Author: Florian Hopfner (@FH-Inway)
#>
Expand Down
17 changes: 9 additions & 8 deletions d365fo.tools/internal/functions/publish-d365foresources.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@

<#
.SYNOPSIS
Publish resources
.DESCRIPTION
Publishes Dynamics 365 for Finance and Operations resources to the publishing directory.
.PARAMETER ResourceTypes
The types of resources to publish.
.PARAMETER PublishingDirectory
The directory to publish the resources to. Each resource type will be published to a subdirectory.
.PARAMETER PackageDirectory
The directory containing the resources.
.PARAMETER AosServiceWebRootPath
The path to the AOS service web root containing the metadata assemblies to access the resources.
.EXAMPLE
PS C:\> Publish-D365FOResources -ResourceTypes Images,Scripts,Styles,Html -PublishingDirectory C:\temp\resources
This will publish the resources of the types Images, Scripts, Styles, and Html to the directory C:\temp\resources.
.NOTES
Author: Florian Hopfner (@FH-Inway)
#>
Expand Down
49 changes: 49 additions & 0 deletions d365fo.tools/tests/functions/Publish-D365WebResources.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Describe "Publish-D365WebResources Unit Tests" -Tag "Unit" {
BeforeAll {
# Place here all things needed to prepare for the tests
}
AfterAll {
# Here is where all the cleanup tasks go
}

Describe "Ensuring unchanged command signature" {
It "should have the expected parameter sets" {
(Get-Command Publish-D365WebResources).ParameterSets.Name | Should -Be '__AllParameterSets'
}

It 'Should have the expected parameter PackageDirectory' {
$parameter = (Get-Command Publish-D365WebResources).Parameters['PackageDirectory']
$parameter.Name | Should -Be 'PackageDirectory'
$parameter.ParameterType.ToString() | Should -Be PSFramework.Parameter.PathDirectoryParameter
$parameter.IsDynamic | Should -Be $False
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be 0
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
It 'Should have the expected parameter AosServiceWebRootPath' {
$parameter = (Get-Command Publish-D365WebResources).Parameters['AosServiceWebRootPath']
$parameter.Name | Should -Be 'AosServiceWebRootPath'
$parameter.ParameterType.ToString() | Should -Be PSFramework.Parameter.PathDirectoryParameter
$parameter.IsDynamic | Should -Be $False
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be 1
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
}
}

Describe "Testing parameterset __AllParameterSets" {
<#
__AllParameterSets -
__AllParameterSets -PackageDirectory -AosServiceWebRootPath
#>
}

}
74 changes: 74 additions & 0 deletions docs/Publish-D365WebResources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
external help file: d365fo.tools-help.xml
Module Name: d365fo.tools
online version:
schema: 2.0.0
---

# Publish-D365WebResources

## SYNOPSIS
Deploy web resources

## SYNTAX

```
Publish-D365WebResources [[-PackageDirectory] <PathDirectoryParameter>]
[[-AosServiceWebRootPath] <PathDirectoryParameter>] [<CommonParameters>]
```

## DESCRIPTION
Deploys the Dynamics 365 for Finance and Operations web resources to the AOS service web root path.

## EXAMPLES

### EXAMPLE 1
```
Publish-D365WebResources
```

This will deploy the web resources to the AOS service web root path.

## PARAMETERS

### -PackageDirectory
Path to the package directory containing the web resources.

```yaml
Type: PathDirectoryParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: $Script:PackageDirectory
Accept pipeline input: False
Accept wildcard characters: False
```
### -AosServiceWebRootPath
Path to the AOS service web root path.
```yaml
Type: PathDirectoryParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: $Script:AOSPath
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).
## INPUTS
## OUTPUTS
## NOTES
Author: Florian Hopfner (@FH-Inway)
## RELATED LINKS

0 comments on commit ad952c0

Please sign in to comment.