-
Notifications
You must be signed in to change notification settings - Fork 18
Add Microsoft.PowerShell.PlatyPS documentation #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
NowinskiK
merged 24 commits into
dataplat:develop
from
Gijsreyn:microsoft-powershell-platyps
Jul 19, 2025
Merged
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
db7136a
Add Microsoft.PowerShell.PlatyPS documentation
Gijsreyn 9f0ecea
Update build.yaml
Gijsreyn 21a5ab0
Add additional docs by ignoring import
Gijsreyn 9b6a4c8
Update example docs
Gijsreyn 958a96b
Update example docs
Gijsreyn 3628750
Update example docs
Gijsreyn baa7ce7
Update example docs
Gijsreyn 4fc886e
Update example docs
Gijsreyn 9ddd1b7
Update example docs
Gijsreyn 4050d5f
Update docs
Gijsreyn 7968154
Remove ignore
Gijsreyn 58d3fca
Fix examples and add module file
Gijsreyn a162fec
Resolve remarks
Gijsreyn a24a683
Remove line breaks
Gijsreyn 9f98f6c
Resolve loop remarks
Gijsreyn 9d0127e
Update remark
Gijsreyn b318e90
Change input suggestion
Gijsreyn efc217d
Fix test
Gijsreyn a3e423e
Remove known issue
Gijsreyn 476fe6d
Resolve conflict
Gijsreyn 72b105c
Merge branch 'develop' into microsoft-powershell-platyps
NowinskiK ad87a56
Last comment
Gijsreyn b805051
Merge branch 'microsoft-powershell-platyps' of https://github.com/Gij…
Gijsreyn 154ae13
Last comment
Gijsreyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
155 changes: 155 additions & 0 deletions
155
.build/tasks/generateHelp.Microsoft.PowerShell.PlatyPS.build.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| param | ||
| ( | ||
| [Parameter()] | ||
| [System.IO.DirectoryInfo] | ||
| $ProjectPath = (property ProjectPath $BuildRoot), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $ProjectName = (property ProjectName ''), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $SourcePath = (property SourcePath ''), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $HelpSourceFolder = (property HelpSourceFolder 'docs'), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $OutputDirectory = (property OutputDirectory 'output'), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $BuiltModuleSubdirectory = (property BuiltModuleSubdirectory ''), | ||
|
|
||
| [Parameter()] | ||
| [System.Management.Automation.SwitchParameter] | ||
| $VersionedOutputDirectory = (property VersionedOutputDirectory $true), | ||
|
|
||
| [Parameter()] | ||
| [System.String] | ||
| $HelpOutputFolder = (property HelpOutputFolder 'help'), | ||
|
|
||
| [Parameter()] | ||
| [cultureInfo] | ||
| $HelpCultureInfo = 'en-US', | ||
|
|
||
| [Parameter()] | ||
| [System.Management.Automation.SwitchParameter] | ||
| $CopyHelpMamlToBuiltModuleBase = (property CopyHelpMamlToBuiltModuleBase $true), | ||
|
|
||
| # Build Configuration object | ||
| [Parameter()] | ||
| [System.Collections.Hashtable] | ||
| $BuildInfo = (property BuildInfo @{ }) | ||
| ) | ||
|
|
||
| function Get-GenerateHelpPSVariables | ||
| { | ||
| param () | ||
|
|
||
| $script:PesterOutputFolder = Get-SamplerAbsolutePath -Path $PesterOutputFolder -RelativeTo $OutputDirectory | ||
|
|
||
| "`tPester Output Folder = '$PesterOutputFolder" | ||
|
|
||
| $script:HelpSourceFolder = Get-SamplerAbsolutePath -Path $HelpSourceFolder -RelativeTo $ProjectPath | ||
| "`tHelp Source Folder = '$HelpSourceFolder'" | ||
|
|
||
| $script:HelpOutputFolder = Get-SamplerAbsolutePath -Path $HelpOutputFolder -RelativeTo $OutputDirectory | ||
| "`tHelp output Folder = '$HelpOutputFolder'" | ||
|
|
||
| if ($ModuleVersion) | ||
| { | ||
| $script:HelpOutputVersionFolder = Get-SamplerAbsolutePath -Path $ModuleVersion -RelativeTo $HelpOutputFolder | ||
| } | ||
|
|
||
| "`tHelp output Version Folder = '$HelpOutputVersionFolder'" | ||
|
|
||
| $script:HelpOutputCultureFolder = Get-SamplerAbsolutePath -Path $HelpCultureInfo -RelativeTo $HelpOutputVersionFolder | ||
| "`tHelp output Culture path = '$HelpOutputCultureFolder'" | ||
|
|
||
| $script:DocOutputFolder = Get-SamplerAbsolutePath -Path 'docs' -RelativeTo $OutputDirectory | ||
| "`tDocs output folder path = '$DocOutputFolder'" | ||
| } | ||
|
|
||
| # Synopsis: Produces markdown help files from the built module. | ||
| task Generate_help_from_built_module { | ||
| . Set-SamplerTaskVariable | ||
|
|
||
| Get-GenerateHelpPSVariables | ||
|
|
||
| $generateHelpCommands = @" | ||
| `$env:PSModulePath = '$Env:PSModulePath' | ||
| `$targetModule = Import-Module -Name '$ProjectName' -ErrorAction Stop -Passthru | ||
|
|
||
| `$helpDestination = Join-Path '$HelpSourceFolder' -ChildPath '$HelpCultureInfo' | ||
|
|
||
| if (!(Test-Path -Path `$helpDestination)) { | ||
| New-Item -Path `$helpDestination -ItemType Directory -Force -ErrorAction Ignore | Out-Null | ||
| } | ||
|
|
||
| `$docOutputFolder = Join-Path '$DocOutputFolder' -ChildPath '$ProjectName' | ||
|
|
||
| `$commandsArray = @() | ||
| foreach (`$publicFunction in `$targetModule.ExportedFunctions.Keys) { | ||
| `$command = Get-Command -Name `$publicFunction -Module `$targetModule | ||
|
|
||
| `$newMarkdownCommandHelpParams = @{ | ||
| CommandInfo = `$command | ||
| OutputFolder = '$DocOutputFolder' | ||
| HelpVersion = `$targetModule.Version | ||
| Locale = '$HelpCultureInfo' | ||
| Encoding = 'utf8' | ||
| Force = `$true | ||
| } | ||
| `$Output = New-MarkdownCommandHelp @newMarkdownCommandHelpParams | ||
|
|
||
| `$helpCommand = Import-MarkdownCommandHelp -Path `$Output -ErrorAction Ignore | ||
|
|
||
| # Add the command to the array | ||
| `$commandsArray += `$helpCommand | ||
|
|
||
| # Known issue: https://github.com/PowerShell/platyPS/issues/735 | ||
| `$whatIf = `$helpCommand.Parameters | Where-Object -Property Name -EQ 'WhatIf' | ||
| if (`$whatIf) { | ||
| (`$helpCommand.Parameters | Where-Object -Property Name -EQ 'WhatIf').Description = 'Tells PowerShell to run the command in a mode that only reports what would happen, but not actually let the command run or make changes.' | ||
| } | ||
|
|
||
| `$confirm = `$helpCommand.Parameters | Where-Object -Property Name -EQ 'Confirm' | ||
| if (`$confirm) { | ||
| (`$helpCommand.Parameters | Where-Object -Property Name -EQ 'Confirm').Description = 'Prompts you for confirmation before running the cmdlet.' | ||
| } | ||
|
|
||
| `$alias = Get-Alias -Definition `$command.Name -ErrorAction Ignore | ||
|
|
||
| if (`$alias) { | ||
| `$helpCommand.Aliases = @(`$alias.Name) | ||
| } else { | ||
| `$helpCommand.Aliases = @() | ||
| } | ||
|
|
||
| `$helpCommand | Export-MarkdownCommandHelp -OutputFolder '$DocOutputFolder' -Force | ||
|
|
||
| Copy-Item -Path `$Output -Destination `$helpDestination -Force | ||
| } | ||
|
|
||
| `$newMarkdownModuleFileParams = @{ | ||
| CommandHelp = `$commandsArray | ||
| OutputFolder = '$DocOutputFolder' | ||
| Force = `$true | ||
| } | ||
| `$markdownFile = New-MarkdownModuleFile @newMarkdownModuleFileParams | ||
|
|
||
| if (`$markdownFile) { | ||
| Copy-Item -Path `$markdownFile -Destination `$helpDestination -Force | ||
| } | ||
|
|
||
| "@ | ||
| Write-Build -Color DarkGray -Text "$generateHelpCommands" | ||
| $sb = [ScriptBlock]::create($generateHelpCommands) | ||
|
|
||
| $pwshPath = (Get-Process -Id $PID).Path | ||
| &$pwshPath -Command $sb -ExecutionPolicy 'ByPass' | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
docs/en-US/Add-FabricDomainWorkspaceAssignmentByCapacity.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| document type: cmdlet | ||
| external help file: FabricTools-Help.xml | ||
| HelpUri: '' | ||
| Locale: en-US | ||
| Module Name: FabricTools | ||
| ms.date: 07/14/2025 | ||
| PlatyPS schema version: 2024-05-01 | ||
| title: Add-FabricDomainWorkspaceAssignmentByCapacity | ||
| --- | ||
|
|
||
| # Add-FabricDomainWorkspaceAssignmentByCapacity | ||
|
|
||
| ## SYNOPSIS | ||
|
|
||
| Assigns workspaces to a Fabric domain based on specified capacities. | ||
|
|
||
| ## SYNTAX | ||
|
|
||
| ### __AllParameterSets | ||
|
|
||
| ``` | ||
| Add-FabricDomainWorkspaceAssignmentByCapacity [-DomainId] <guid> [-CapacitiesIds] <guid[]> | ||
| [<CommonParameters>] | ||
| ``` | ||
|
|
||
| ## ALIASES | ||
|
|
||
| Assign-FabricDomainWorkspaceByCapacity | ||
|
|
||
| ## DESCRIPTION | ||
|
|
||
| The `Add-FabricDomainWorkspaceAssignmentByCapacity` function assigns workspaces to a Fabric domain using a list of capacity IDs by making a POST request to the relevant API endpoint. | ||
|
|
||
| ## EXAMPLES | ||
|
|
||
| ### EXAMPLE 1 | ||
|
|
||
| Assigns workspaces to the domain with ID "12345" based on the specified capacities. | ||
|
|
||
| ```powershell | ||
| Add-FabricDomainWorkspaceAssignmentByCapacity -DomainId "12345" -CapacitiesIds @("capacity1", "capacity2") | ||
| ``` | ||
|
|
||
| ## PARAMETERS | ||
|
|
||
| ### -CapacitiesIds | ||
|
|
||
| An array of capacity IDs used to assign workspaces to the domain. | ||
|
|
||
| ```yaml | ||
| Type: System.Guid[] | ||
| DefaultValue: '' | ||
| SupportsWildcards: false | ||
| Aliases: [] | ||
| ParameterSets: | ||
| - Name: (All) | ||
| Position: 1 | ||
| IsRequired: true | ||
| ValueFromPipeline: false | ||
| ValueFromPipelineByPropertyName: false | ||
| ValueFromRemainingArguments: false | ||
| DontShow: false | ||
| AcceptedValues: [] | ||
| HelpMessage: '' | ||
| ``` | ||
|
|
||
| ### -DomainId | ||
|
|
||
| The unique identifier of the Fabric domain to which the workspaces will be assigned. | ||
|
|
||
| ```yaml | ||
| Type: System.Guid | ||
| DefaultValue: '' | ||
| SupportsWildcards: false | ||
| Aliases: [] | ||
| ParameterSets: | ||
| - Name: (All) | ||
| Position: 0 | ||
| IsRequired: true | ||
| ValueFromPipeline: false | ||
| ValueFromPipelineByPropertyName: false | ||
| ValueFromRemainingArguments: false | ||
| DontShow: false | ||
| AcceptedValues: [] | ||
| HelpMessage: '' | ||
| ``` | ||
|
|
||
| ### CommonParameters | ||
|
|
||
| This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, | ||
| -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, | ||
| -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see | ||
| [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). | ||
|
|
||
| ## INPUTS | ||
|
|
||
| ## OUTPUTS | ||
|
|
||
| ## NOTES | ||
|
|
||
| - Requires `$FabricConfig` global configuration, including `BaseUrl` and `FabricHeaders`. | ||
| - Calls `Confirm-TokenState` to ensure token validity before making the API request. | ||
|
|
||
| Author: Tiago Balabuch | ||
|
|
||
| ## RELATED LINKS | ||
|
|
||
| {{ Fill in the related links here }} | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.