Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
merill committed May 24, 2024
1 parent d3a610f commit d505e1e
Show file tree
Hide file tree
Showing 71 changed files with 21,759 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Regenerates the documentation for the "Command Reference" section of the site https://maester.dev
name: build-docs

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow updates to the repository
permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update docs
run: ./build/Update-CommandReference.ps1
shell: pwsh

- name: Create PR to update repo
uses: peter-evans/create-pull-request@v6
with:
title: Update command reference
31 changes: 31 additions & 0 deletions build/Update-CommandReference.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Description: This script is used to generate the 'Command Reference' section of the Maester docusaurus site
# * This command needs to be run from the root of the project. e.g. ./build/Build-CommandReference.ps1
# * If running the docusaurus site locally you will need to stop and start Docusaurus to clear the 'Module not found' errors after running this command

if (-not (Get-Module Alt3.Docusaurus.Powershell -ListAvailable)) { Install-Module Alt3.Docusaurus.Powershell -Scope CurrentUser -Force -SkipPublisherCheck }
if (-not (Get-Module PlatyPS -ListAvailable)) { Install-Module PlatyPS -Scope CurrentUser -Force -SkipPublisherCheck }

Import-Module Alt3.Docusaurus.Powershell
Import-Module PlatyPS

# Generate the command reference markdown
$commandsIndexFile = "./website/docs/commands/readme.md"
$readmeContent = Get-Content $commandsIndexFile # Backup the readme.md since it will be deleted by New-DocusaurusHelp

# Get all the filenames in the ./powershell/internal folder wihtout the extension
$internalCommands = Get-ChildItem ./src/internal -Filter *.ps1 | ForEach-Object { $_.BaseName }

New-DocusaurusHelp -Module ./src/MSIdentityTools.psm1 -DocsFolder ./website/docs -NoPlaceHolderExamples -EditUrl https://github.com/maester365/maester/blob/main/powershell/public/ -Exclude $internalCommands

# Update the markdown to include the synopsis as description so it can be displayed correctly in the doc links.
$cmdMarkdownFiles = Get-ChildItem ./website/docs/commands
foreach ($file in $cmdMarkdownFiles) {
$content = Get-Content $file
$synopsis = $content[($content.IndexOf("## SYNOPSIS") + 2)] # Get the synopsis
if (![string]::IsNullOrWhiteSpace($synopsis)) {
$updatedContent = $content.Replace("id:", "sidebar_class_name: hidden`ndescription: $($synopsis)`nid:")
Set-Content $file $updatedContent
}
}

Set-Content $commandsIndexFile $readmeContent # Restore the readme content
20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
83 changes: 83 additions & 0 deletions website/docs/commands/Add-MsIdServicePrincipal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
sidebar_class_name: hidden
description: Create service principal for existing application registration
id: Add-MsIdServicePrincipal
title: Add-MsIdServicePrincipal
hide_title: false
hide_table_of_contents: false
custom_edit_url: https://github.com/maester365/maester/blob/main/powershell/public/Add-MsIdServicePrincipal.ps1
---

## SYNOPSIS

Create service principal for existing application registration

## SYNTAX

```powershell
Add-MsIdServicePrincipal [-AppId] <String[]> [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION

\{\{ Fill in the Description \}\}

## EXAMPLES

### EXAMPLE 1

```powershell
Add-MsIdServicePrincipal 10000000-0000-0000-0000-000000000001
```

Create service principal for existing appId, 10000000-0000-0000-0000-000000000001.

## PARAMETERS

### -AppId

AppID of Application

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
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).
## INPUTS
### System.String
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS
91 changes: 91 additions & 0 deletions website/docs/commands/Confirm-MsIdJwtTokenSignature.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
sidebar_class_name: hidden
description: Validate the digital signature for JSON Web Token.
id: Confirm-MsIdJwtTokenSignature
title: Confirm-MsIdJwtTokenSignature
hide_title: false
hide_table_of_contents: false
custom_edit_url: https://github.com/maester365/maester/blob/main/powershell/public/Confirm-MsIdJwtTokenSignature.ps1
---

## SYNOPSIS

Validate the digital signature for JSON Web Token.

## SYNTAX

```powershell
Confirm-MsIdJwtTokenSignature [-Tokens] <String[]> [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION

\{\{ Fill in the Description \}\}

## EXAMPLES

### EXAMPLE 1

```powershell
Confirm-MsIdJwtTokenSignature $OpenIdConnectToken
```

Validate the OpenId token was signed by token issuer based on the OIDC Provider Configuration for token issuer.

### EXAMPLE 2

```powershell
Confirm-MsIdJwtTokenSignature $AccessToken
```

Validate the access token was signed by token issuer based on the OIDC Provider Configuration for token issuer.

## PARAMETERS

### -Tokens

JSON Web Token (JWT)

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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).
## INPUTS
### System.String
## OUTPUTS
### System.Boolean
## NOTES
## RELATED LINKS
92 changes: 92 additions & 0 deletions website/docs/commands/ConvertFrom-MsIdAadcAadConnectorSpaceDn.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
sidebar_class_name: hidden
description: Convert Azure AD connector space object Distinguished Name (DN) in AAD Connect
id: ConvertFrom-MsIdAadcAadConnectorSpaceDn
title: ConvertFrom-MsIdAadcAadConnectorSpaceDn
hide_title: false
hide_table_of_contents: false
custom_edit_url: https://github.com/maester365/maester/blob/main/powershell/public/ConvertFrom-MsIdAadcAadConnectorSpaceDn.ps1
---

## SYNOPSIS

Convert Azure AD connector space object Distinguished Name (DN) in AAD Connect

## SYNTAX

```powershell
ConvertFrom-MsIdAadcAadConnectorSpaceDn [-InputObject] <String> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

## DESCRIPTION

\{\{ Fill in the Description \}\}

## EXAMPLES

### EXAMPLE 1

```powershell
ConvertFrom-MsIdAadcAadConnectorSpaceDn 'CN={414141414141414141414141414141414141414141413D3D}'
```

Convert Azure AD connector space object DN in AAD Connect to sourceAnchor and sourceGuid.

### EXAMPLE 2

```powershell
'CN={4F626A656374547970655F30303030303030302D303030302D303030302D303030302D303030303030303030303030}' | ConvertFrom-MsIdAadcAadConnectorSpaceDn
```

Convert Azure AD connector space object DN in AAD Connect to cloudAnchor and cloudGuid.

## PARAMETERS

### -InputObject

Azure AD Connector Space DN from AAD Connect

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

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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).
## INPUTS
### System.String
## OUTPUTS
### System.Management.Automation.PSObject
## NOTES
## RELATED LINKS
Loading

0 comments on commit d505e1e

Please sign in to comment.