-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #499 from TheJumpCloud/SA-3334_MTPImportUpdate
Sa 3334 mtp import update
- Loading branch information
Showing
22 changed files
with
1,655 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -49,11 +49,11 @@ parameters: | |
PublishToPSGallery: | ||
description: "When `true` and when run against Master branch, this workflow will publish the latest code to PSGallery" | ||
type: boolean | ||
default: false | ||
default: true | ||
ManualModuleVersion: | ||
description: "When `true` the pipeline will use the Module Version specified in JumpCloud Module JumpCloud.psd1 file" | ||
type: boolean | ||
default: false | ||
default: true | ||
orbs: | ||
win: circleci/[email protected] | ||
executors: | ||
|
@@ -135,6 +135,13 @@ workflows: | |
- Build Nuspec | ||
- Invoke Git Commit | ||
context: aws-credentials | ||
- Pester Tests Linux MSP: | ||
requires: | ||
- Initial Setup | ||
- Build Help and Test Files | ||
- Build Nuspec | ||
- Invoke Git Commit | ||
context: aws-credentials | ||
- Publish Module Validation: | ||
requires: | ||
- Initial Setup | ||
|
@@ -231,7 +238,7 @@ jobs: | |
- invoke-pester: | ||
JumpCloudApiKey: $env:XAPIKEY_PESTER | ||
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP | ||
ExcludeTagList: "ModuleValidation, JCDeployment" | ||
ExcludeTagList: "ModuleValidation, JCDeployment, MSP" | ||
IncludeTagList: "*" | ||
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >> | ||
Shell: "pwsh.exe" | ||
|
@@ -242,7 +249,7 @@ jobs: | |
- invoke-pester: | ||
JumpCloudApiKey: $env:XAPIKEY_PESTER_MAC | ||
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP | ||
ExcludeTagList: "ModuleValidation, JCDeployment" | ||
ExcludeTagList: "ModuleValidation, JCDeployment, MSP" | ||
IncludeTagList: "*" | ||
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >> | ||
Shell: "pwsh" | ||
|
@@ -254,10 +261,23 @@ jobs: | |
- invoke-pester: | ||
JumpCloudApiKey: $env:XAPIKEY_PESTER_LINUX | ||
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP | ||
ExcludeTagList: "ModuleValidation, JCDeployment" | ||
ExcludeTagList: "ModuleValidation, JCDeployment, MSP" | ||
IncludeTagList: "*" | ||
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >> | ||
Shell: "pwsh" | ||
Pester Tests Linux MSP: | ||
machine: | ||
image: ubuntu-2004:202201-02 | ||
steps: | ||
- setup-pester-env-linux | ||
- invoke-pester: | ||
JumpCloudApiKey: $env:XAPIKEY_PESTER_MTP | ||
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP | ||
JumpCloudMspOrg: $env:XORGID_PesterMSP | ||
ExcludeTagList: "None" | ||
IncludeTagList: "MSP" | ||
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >> | ||
Shell: "pwsh" | ||
Publish Module Validation: | ||
machine: | ||
image: ubuntu-2004:202201-02 | ||
|
@@ -513,6 +533,9 @@ commands: | |
JumpCloudApiKeyMsp: | ||
type: string | ||
default: $env:XAPIKEY_PESTER_MTP | ||
JumpCloudMspOrg: | ||
type: string | ||
default: $env:XORGID_PesterMSP | ||
ExcludeTagList: | ||
type: string | ||
default: "None" | ||
|
@@ -539,7 +562,7 @@ commands: | |
command: | | ||
$ErrorActionPreference = 'stop' | ||
./PowerShell\Deploy\SdkSync\jcapiToSupportSync.ps1 -RequiredModulesRepo << pipeline.parameters.RequiredModulesRepo >> | ||
. "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKey << parameters.JumpCloudApiKey >> -JumpCloudApiKeyMsp << parameters.JumpCloudApiKeyMsp >> -ExcludeTagList << parameters.ExcludeTagList >> -IncludeTagList << parameters.IncludeTagList >> -RequiredModulesRepo << parameters.RequiredModulesRepo >> | ||
. "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKey << parameters.JumpCloudApiKey >> -JumpCloudApiKeyMsp << parameters.JumpCloudApiKeyMsp >> -JumpCloudMspOrg << parameters.JumpCloudMspOrg >> -ExcludeTagList << parameters.ExcludeTagList >> -IncludeTagList << parameters.IncludeTagList >> -RequiredModulesRepo << parameters.RequiredModulesRepo >> | ||
- store_test_results: | ||
name: Uploading test results' | ||
path: "./PowerShell/JumpCloud Module/Tests/test_results/" | ||
|
This file contains 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
115 changes: 115 additions & 0 deletions
115
PowerShell/JumpCloud Module/Docs/Import-JCMSPFromCSV.md
This file contains 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,115 @@ | ||
--- | ||
external help file: JumpCloud-help.xml | ||
Module Name: JumpCloud | ||
online version: https://github.com/TheJumpCloud/support/wiki/ | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Import-JCMSPFromCSV | ||
|
||
## SYNOPSIS | ||
|
||
Imports a list of JumpCloud MSP organizations from a CSV file created using the New-JCMSPImportTemplate function. | ||
|
||
## SYNTAX | ||
|
||
### GUI (Default) | ||
``` | ||
Import-JCMSPFromCSV [-CSVFilePath] <String> [<CommonParameters>] | ||
``` | ||
|
||
### force | ||
``` | ||
Import-JCMSPFromCSV [-CSVFilePath] <String> [-force] [-ProviderID <String>] [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
The Import-JCMSPFromCSV function does data validation when updating JumpCloud Organizations in bulk from a CSV file to warn the administrator of any potential issues during the import process. Examples of warnings include warning messages for organizations whose name already exists and duplicate organization names in the CSV file. | ||
|
||
The Import-JCMSPFromCSV command can be used to import organization names and max user counts. | ||
|
||
The Import-JCMSPFromCSV command also has a '-force' parameter which admins can use to skip the gui validation or to use the function in an automation script. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
|
||
```powershell | ||
PS C:\> Import-JCMSPFromCSV ./JCMSPImport_06-14-2023.csv | ||
``` | ||
|
||
Imports MSP orgs from the .csv file 'JCMSPImport_06-14-2023.csv' | ||
|
||
### Example 2 | ||
|
||
```powershell | ||
PS C:\> Import-JCMSPFromCSV ./JCMSPImport_06-14-2023.csv -Force | ||
``` | ||
|
||
Uses the 'Force' parameter to skip the GUI and data validation and import MSP orgs from the file 'JCMSPImport_06-14-2023.csv | ||
|
||
## PARAMETERS | ||
|
||
### -CSVFilePath | ||
|
||
The full path to the CSV file you wish to import. | ||
You can use tab complete to search for .csv files. | ||
|
||
```yaml | ||
Type: System.String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 0 | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -force | ||
A SwitchParameter which suppresses the GUI and data validation when using the Import-JCMSPFromCSV command. | ||
```yaml | ||
Type: System.Management.Automation.SwitchParameter | ||
Parameter Sets: force | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -ProviderID | ||
Your Provider ID | ||
```yaml | ||
Type: System.String | ||
Parameter Sets: force | ||
Aliases: | ||
|
||
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 | ||
### None | ||
## OUTPUTS | ||
### System.Object | ||
## NOTES | ||
## RELATED LINKS |
This file contains 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 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
85 changes: 85 additions & 0 deletions
85
PowerShell/JumpCloud Module/Docs/New-JCMSPImportTemplate.md
This file contains 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,85 @@ | ||
--- | ||
external help file: JumpCloud-help.xml | ||
Module Name: JumpCloud | ||
online version: https://github.com/TheJumpCloud/support/wiki/ | ||
schema: 2.0.0 | ||
--- | ||
|
||
# New-JCMSPImportTemplate | ||
|
||
## SYNOPSIS | ||
|
||
Creates a CSV file to either create new or update existing MSP organizations in a MSP tenant. | ||
|
||
## SYNTAX | ||
|
||
``` | ||
New-JCMSPImportTemplate [-Force] [-Type <Object>] [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
The New-JCMSPImportTemplate command is a menu driven function that creates a CSV template for the `Update-JCMSPFromCSV` and `Import-JCMSPFromCSV` functions. Templates for updated existing orgs are populated with the ids, names and max user counts of existing orgs. The template for new organizations is populated with only a name and max user count column. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
|
||
```powershell | ||
PS C:\> New-JCMSPImportTemplate | ||
``` | ||
|
||
Launches the New-JCMSPImportTemplate menu | ||
|
||
## PARAMETERS | ||
|
||
### -Force | ||
|
||
Parameter to force populate CSV with all headers when creating an update template. | ||
When selected this option will forcefully replace existing files in the current working directory. | ||
i.e. | ||
If you | ||
|
||
```yaml | ||
Type: System.Management.Automation.SwitchParameter | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Type | ||
Type of CSV to Create. | ||
Update or Import are valid options. | ||
```yaml | ||
Type: System.Object | ||
Parameter Sets: (All) | ||
Aliases: | ||
Accepted values: Import, Update | ||
|
||
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 | ||
### None | ||
## OUTPUTS | ||
### System.Object | ||
## NOTES | ||
## RELATED LINKS |
This file contains 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
Oops, something went wrong.