Developer PowerShell
Developer PowerShell is a PowerShell profile that is optimized for development. It is a collection of scripts and configurations that are used to set up a development environment. The profile is designed to be used with the OctoMesh development environment.
Definitions and Concepts
- Main Repositories: Most of the CoreService repositories including tools.
- Branch Structure: OctoMesh supports branch-based development with a specific directory structure
Branch Directory Structure
The OctoMesh development environment uses a structured approach for managing branches:
/Users/gerald/RiderProjects/meshmakers/
├── main/ # Main branch repositories
│ ├── octo-*/
│ ├── mm-*/
│ ├── nuget/
│ └── Octo.user.props
└── branches/ # Feature/development branches
├── feature-branch-1/ # Branch-specific repositories
│ ├── octo-*/
│ ├── mm-*/
│ ├── nuget/
│ └── Octo.user.props
└── feature-branch-2/
├── octo-*/
├── mm-*/
├── nuget/
└── Octo.user.props
Branch Parameter: Many PowerShell commands support a -branch parameter to specify which branch directory to operate on:
- Empty string or omitted: Operates directly on the root directory.
- Main branch: When specifying
mainthe scripts operates on themain/directory. - Branch name: Operates on branch-specific directory (
branches/{branch-name}/directory)
Users
Here is a list of users that are needed for main services to connect to mongodb.
| User | Default Password in dev environment | Comment |
|---|---|---|
| octo-system-admin | OctoAdmin1 | User for creating tenants and configuration tenant independent |
| octo-system-ds-user-0 | OctoUser1 | User for the databases, 0 is the name of the database in MongoDB. |
PowerShell Commands
Repository Management
| Command | Description |
|---|---|
| Invoke-CloneMainRepos | Clones all main repositories to your root directory. |
| Sync-AllGitRepos | Pulls all repositories starting with octo-* or mm-*. Branch Parameter: -branch specifies branch directory (empty = main). |
| Sync-GitRepo | Pulls a repository from GitHub using the current directory by default or defining a parameter repositoryPath. |
| Push-GitRepo | Pushes a repository to GitHub using the current directory by default or defining a parameter repositoryPath. |
| Push-AllGitRepos | Pushes all repositories starting with octo-*or mm-*. |
| Get-AllGitRepStatus | Gets the status of all repositories starting with octo-* and mm-*. Branch Parameter: -branch specifies branch directory (empty = main). |
| Compare-BranchStatus | Compares current branch against origin/main for all octo-* and mm-* directories. Shows if commits are code changes, submodule updates, or merges. Use -Details for commit-level information. |
| Invoke-CleanAllGitRepos | Cleans all repositories starting with octo-* and mm-*. The force parameter is set to false by default. |
| Invoke-SwitchAllBranches | Switches all repositories to a specified branch. Branch Parameter: -branch specifies target branch directory. |
Submodule Management
| Command | Description |
|---|---|
| Sync-AllSubmodules | Pulls all submodules of all repositories starting with octo-*. |
| Sync-Submodule | Pulls all submodules of a repository from GitHub using the current directory by default or defining a parameter repositoryPath. |
Build Management
| Command | Description |
|---|---|
| Invoke-Build | Builds a repository for .NET using the current directory by default or defining a parameter repositoryPath. |
| Invoke-BuildAll | Builds all repositories starting with octo-* and a solution file (*.sln). Branch Parameter: -branch specifies branch directory (empty = main). |
| Invoke-Publish | Publishes the current directory by default or defining a parameter repositoryPath. Uses the configuration Release by default. |
| Invoke-BuildFrontend | Builds the octo-frontend-admin-panel repository and reinstalls Node modules |
| Invoke-BuildAndStartOcto | Builds all repositories and starts the main services. |
| Remove-BinAndObjFolders | Recursively deletes bin and obj folders within the specified path. Default path is .! |
Service Management
| Command | Description |
|---|---|
| Start-Octo | Starts the main services. |
Infrastructure Management
For further information on the infrastructure management and requirements please refer to the infrastructure documentation
| Command | Description |
|---|---|
| Install-OctoInfrastructure | Uses the Docker Compose file located at infrastructure to compose the infrastructure dependencies. |
| Uninstall-OctoInfrastructure | Uninstalls the infrastructure dependencies by using the Docker Compose file at infrastructure. |
| Start-OctoInfrastructure | Starts the infrastructure dependencies by using the Docker Compose file at infrastructure. |
| Stop-OctoInfrastructure | Stops the infrastructure dependencies by using the Docker Compose file at infrastructure. |
| Get-OctoInfrastructureStatus | Gets the status of containers by using the Docker Compose file at infrastructure. |
| Invoke-KillDotnet | Windows only. Kills all dotnet processes. This is necessary to avoid file locks during build process. |
NuGet Package Management
| Command | Description |
|---|---|
| Copy-NuGetPackages | Finds NuGet packages for version 999.0.0 and copies them to $NUGETPATH using the current directory by default or defining a parameter directory. Branch Parameter: -branch specifies branch directory. |
| Copy-AllNugetPackages | Scans all octo-* and mm-* directories for NuGet packages for version 999.0.0 and copies them to $NUGETPATH. |
| Remove-GlobalNugetPackages | Removes in the global NuGet package folder ($GLOBALNUGETPACKAGESPATH) all MeshMaker NuGet packages in version 999.0.0. Branch Parameter: -branch specifies branch directory. |
| Sync-NugetPackages | Copies, removes globally, and restores NuGet packages. |
Branch Management
| Command | Description |
|---|---|
| New-TestBranch | Creates a test branch for all octo-* repositories with format /test/0.x-description and updates version in Directory.Build.props. Required Parameters: -Version (2-999), -Description. Optional: -NoPush to skip pushing to remote. |
CLI Management
| Command | Description |
|---|---|
| Invoke-OctoCliLoginLocal | Local login into the CLI. Default tenantId is meshtest. |
| Invoke-OctoCliLoginProduction | Production login into the CLI. |
| Invoke-OctoCliLoginStaging | Staging login into the CLI. |
| Invoke-OctoCliLoginTest2 | Test2 environment login into the CLI. |
| Invoke-OctoCliReconfigureLogLevel | Allows for reconfiguring of Log levels of Identity, AssetRepository, Bot, CommunicationController and AdminPanel. Required Parameters: loggerName, minLogLevel and maxLogLevel |
| Invoke-SetDebugConfiguration | Sets the configuration for the admin panel to debug. Ensure that you have logged in to identity services Invoke-OctoCliLoginLocal |
MongoDB Management
| Command | Description |
|---|---|
| Invoke-MongoBackup | Creates a backup of MongoDB databases. |
| Invoke-MongoRestore | Restores MongoDB databases from backup. |
| Invoke-MongoCompress | Compresses MongoDB backup files. |
| Invoke-MongoUncompress | Uncompresses MongoDB backup files. |
| Invoke-MongoDeleteOctoMesh | Deletes OctoMesh-specific databases from MongoDB. |
Certificate Management
| Command | Description |
|---|---|
| New-RootCertificate | Creates a new root certificate for development purposes. |
| New-ServerCertificate | Creates a new server certificate for development purposes. |
Template Management
| Command | Description |
|---|---|
| Sync-YamlTemplates | Synchronizes YAML templates across repositories. |
| Update-MeshmakerVersion | Updates MeshMaker version references across repositories. |
Repository Discovery
| Command | Description |
|---|---|
| Find-AllGitRepos | Finds all Git repositories in the current directory structure. |
Additional Build Tools
| Command | Description |
|---|---|
| Invoke-BuildZenonPlug | Builds the Zenon plug-in components. |
Kubernetes Management
| Command | Description |
|---|---|
| Join-KubeConfigs | Merges external Kubernetes configuration with existing ~/.kube/config file. externalKubeConfig parameter can be configured. |
| Remove-KubeConfig | Removes Kubernetes configuration with required name parameter. |
Branch Parameter Examples
Working with main branch (default behavior):
Sync-AllGitRepos -branch "main" # Operates on main/ directory
Get-AllGitRepStatus -branch "main" # Shows status for main branch repos
Invoke-BuildAll -configuration Release -branch "main" # Builds main branch
Working with feature branches:
Sync-AllGitRepos -branch "branches/mcp" # Operates on branches/mcp/ directory
Get-AllGitRepStatus -branch "branches/feature-x" # Shows status for feature-x branch repos
Invoke-BuildAll -branch "branches/dev" -configuration Debug # Builds dev branch
Branch status comparison:
Compare-BranchStatus # Quick overview of all octo-*/mm-* repos
Compare-BranchStatus -Details # Detailed view with individual commits
Creating test branches:
New-TestBranch -Version 5 -Description "feature-test" # Creates a branch named /test/0.5-feature-test and pushes it to remote
New-TestBranch -Version 10 -Description "bugfix" -NoPush # Creates branch locally only