├── .github ├── FUNDING.yml └── workflows │ ├── psscriptanalyzer.yml │ └── publish.yml ├── .gitignore ├── Docs ├── Get-HuduActivityLogs.md ├── Get-HuduApiKey.md ├── Get-HuduAppInfo.md ├── Get-HuduArticles.md ├── Get-HuduAssetLayoutFieldID.md ├── Get-HuduAssetLayouts.md ├── Get-HuduAssets.md ├── Get-HuduBaseURL.md ├── Get-HuduCard.md ├── Get-HuduCompanies.md ├── Get-HuduExpirations.md ├── Get-HuduFolderMap.md ├── Get-HuduFolders.md ├── Get-HuduIntegrationMatchers.md ├── Get-HuduMagicDashes.md ├── Get-HuduObjectByUrl.md ├── Get-HuduPasswords.md ├── Get-HuduProcesses.md ├── Get-HuduPublicPhotos.md ├── Get-HuduRelations.md ├── Get-HuduWebsites.md ├── Initialize-HuduFolder.md ├── New-HuduAPIKey.md ├── New-HuduArticle.md ├── New-HuduAsset.md ├── New-HuduAssetLayout.md ├── New-HuduBaseURL.md ├── New-HuduCompany.md ├── New-HuduFolder.md ├── New-HuduPassword.md ├── New-HuduPublicPhoto.md ├── New-HuduRelation.md ├── New-HuduWebsite.md ├── Remove-HuduAPIKey.md ├── Remove-HuduArticle.md ├── Remove-HuduAsset.md ├── Remove-HuduBaseURL.md ├── Remove-HuduMagicDash.md ├── Remove-HuduPassword.md ├── Remove-HuduRelation.md ├── Remove-HuduWebsite.md ├── Set-HuduArticle.md ├── Set-HuduArticleArchive.md ├── Set-HuduAsset.md ├── Set-HuduAssetArchive.md ├── Set-HuduAssetLayout.md ├── Set-HuduCompany.md ├── Set-HuduCompanyArchive.md ├── Set-HuduFolder.md ├── Set-HuduIntegrationMatcher.md ├── Set-HuduMagicDash.md ├── Set-HuduPassword.md ├── Set-HuduPasswordArchive.md └── Set-HuduWebsite.md ├── HuduAPI ├── HuduAPI.psd1 ├── HuduAPI.psm1 ├── Private │ ├── ArgumentCompleters │ │ └── AssetLayoutCompleter.ps1 │ ├── Get-HuduCompanyFolders.ps1 │ ├── Get-HuduFolderCleanName.ps1 │ ├── Get-HuduSubFolders.ps1 │ ├── Invoke-HuduRequest.ps1 │ └── Invoke-HuduRequestPaginated.ps1 └── Public │ ├── Get-HuduActivityLogs.ps1 │ ├── Get-HuduApiKey.ps1 │ ├── Get-HuduAppInfo.ps1 │ ├── Get-HuduArticles.ps1 │ ├── Get-HuduAssetLayoutFieldID.ps1 │ ├── Get-HuduAssetLayouts.ps1 │ ├── Get-HuduAssets.ps1 │ ├── Get-HuduBaseURL.ps1 │ ├── Get-HuduCard.ps1 │ ├── Get-HuduCompanies.ps1 │ ├── Get-HuduExpirations.ps1 │ ├── Get-HuduFolderMap.ps1 │ ├── Get-HuduFolders.ps1 │ ├── Get-HuduIntegrationMatchers.ps1 │ ├── Get-HuduMagicDashes.ps1 │ ├── Get-HuduObjectByUrl.ps1 │ ├── Get-HuduPasswordFolders.ps1 │ ├── Get-HuduPasswords.ps1 │ ├── Get-HuduProcesses.ps1 │ ├── Get-HuduPublicPhotos.ps1 │ ├── Get-HuduRelations.ps1 │ ├── Get-HuduUploads.ps1 │ ├── Get-HuduUsers.ps1 │ ├── Get-HuduWebsites.ps1 │ ├── Initialize-HuduFolder.ps1 │ ├── Move-HuduAssetsToNewLayout.ps1 │ ├── Move-HuduAssetsToNewLayoutDeprecated.ps1 │ ├── New-HuduAPIKey.ps1 │ ├── New-HuduArticle.ps1 │ ├── New-HuduAsset.ps1 │ ├── New-HuduAssetLayout.ps1 │ ├── New-HuduBaseURL.ps1 │ ├── New-HuduCompany.ps1 │ ├── New-HuduCustomHeaders.ps1 │ ├── New-HuduFolder.ps1 │ ├── New-HuduPassword.ps1 │ ├── New-HuduPublicPhoto.ps1 │ ├── New-HuduRelation.ps1 │ ├── New-HuduUpload.ps1 │ ├── New-HuduWebsite.ps1 │ ├── Remove-HuduAPIKey.ps1 │ ├── Remove-HuduArticle.ps1 │ ├── Remove-HuduAsset.ps1 │ ├── Remove-HuduBaseURL.ps1 │ ├── Remove-HuduCompany.ps1 │ ├── Remove-HuduCustomHeaders.ps1 │ ├── Remove-HuduMagicDash.ps1 │ ├── Remove-HuduPassword.ps1 │ ├── Remove-HuduRelation.ps1 │ ├── Remove-HuduUpload.ps1 │ ├── Remove-HuduWebsite.ps1 │ ├── Set-HuduArticle.ps1 │ ├── Set-HuduArticleArchive.ps1 │ ├── Set-HuduAsset.ps1 │ ├── Set-HuduAssetArchive.ps1 │ ├── Set-HuduAssetLayout.ps1 │ ├── Set-HuduCompany.ps1 │ ├── Set-HuduCompanyArchive.ps1 │ ├── Set-HuduFolder.ps1 │ ├── Set-HuduIntegrationMatcher.ps1 │ ├── Set-HuduMagicDash.ps1 │ ├── Set-HuduPassword.ps1 │ ├── Set-HuduPasswordArchive.ps1 │ └── Set-HuduWebsite.ps1 ├── LICENSE ├── README.md ├── Tools └── Update-Documentation.ps1 └── build.psd1 /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: lwhitelock 2 | -------------------------------------------------------------------------------- /.github/workflows/psscriptanalyzer.yml: -------------------------------------------------------------------------------- 1 | name: Run PSScriptAnalyzer 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | 7 | jobs: 8 | check: 9 | name: Check 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - name: Run PSScriptAnalyzer 15 | uses: microsoft/psscriptanalyzer-action@v1.1 16 | with: 17 | path: .\HuduAPI 18 | recurse: true 19 | output: results.sarif 20 | 21 | - name: Upload SARIF results file 22 | uses: github/codeql-action/upload-sarif@v2 23 | with: 24 | sarif_file: results.sarif -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish New Version 2 | 3 | on: 4 | push: 5 | tags: '*' 6 | 7 | jobs: 8 | publish: 9 | name: Publish 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - name: PowerShell script 15 | uses: Amadevus/pwsh-script@v2.0.3 16 | id: Build-Module 17 | with: 18 | script: | 19 | Install-Module ModuleBuilder -Force 20 | Build-Module 21 | 22 | - name: Update Metadata 23 | uses: natescherer/update-powershell-metadata-action@v2 24 | with: 25 | path: .\Output\HuduAPI 26 | version: ${{ github.ref_name }} 27 | 28 | - name: Publish PowerShell Module 29 | uses: pcgeek86/publish-powershell-module-action@v20 30 | with: 31 | modulePath: .\Output\HuduAPI 32 | NuGetApiKey: ${{ secrets.PS_GALLERY_KEY }} 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Output -------------------------------------------------------------------------------- /Docs/Get-HuduActivityLogs.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduActivityLogs 9 | 10 | ## SYNOPSIS 11 | Get activity logs for account 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduActivityLogs [[-UserId] ] [[-UserEmail] ] [[-ResourceId] ] 17 | [[-ResourceType] ] [[-ActionMessage] ] [[-StartDate] ] [[-EndDate] ] 18 | [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Calls Hudu API to retrieve activity logs with filters 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Get-HuduActivityLogs -StartDate 2023-02-01 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -UserId 34 | Filter logs by user_id 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: user_id 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -UserEmail 49 | Filter logs by email address 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: user_email 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -ResourceId 64 | Filter logs by resource id. 65 | Must be coupled with resource_type 66 | 67 | ```yaml 68 | Type: Int32 69 | Parameter Sets: (All) 70 | Aliases: resource_id 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -ResourceType 80 | Filter logs by resource type (Asset, AssetPassword, Company, Article, etc.). 81 | Must be coupled with resource_id 82 | 83 | ```yaml 84 | Type: String 85 | Parameter Sets: (All) 86 | Aliases: resource_type 87 | 88 | Required: False 89 | Position: 4 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -ActionMessage 96 | Filter logs by action 97 | 98 | ```yaml 99 | Type: String 100 | Parameter Sets: (All) 101 | Aliases: action_message 102 | 103 | Required: False 104 | Position: 5 105 | Default value: None 106 | Accept pipeline input: False 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### -StartDate 111 | Filter logs by start date. 112 | Converts string to ISO 8601 format 113 | 114 | ```yaml 115 | Type: DateTime 116 | Parameter Sets: (All) 117 | Aliases: start_date 118 | 119 | Required: False 120 | Position: 6 121 | Default value: None 122 | Accept pipeline input: False 123 | Accept wildcard characters: False 124 | ``` 125 | 126 | ### -EndDate 127 | Filter logs by end date, should be coupled with start date to limit results 128 | 129 | ```yaml 130 | Type: DateTime 131 | Parameter Sets: (All) 132 | Aliases: end_date 133 | 134 | Required: False 135 | Position: 7 136 | Default value: None 137 | Accept pipeline input: False 138 | Accept wildcard characters: False 139 | ``` 140 | 141 | ### CommonParameters 142 | 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). 143 | 144 | ## INPUTS 145 | 146 | ## OUTPUTS 147 | 148 | ## NOTES 149 | 150 | ## RELATED LINKS 151 | -------------------------------------------------------------------------------- /Docs/Get-HuduApiKey.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduApiKey 9 | 10 | ## SYNOPSIS 11 | Get Hudu API key 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduApiKey [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Returns Hudu API key in securestring format 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduApiKey 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | 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). 33 | 34 | ## INPUTS 35 | 36 | ## OUTPUTS 37 | 38 | ## NOTES 39 | 40 | ## RELATED LINKS 41 | -------------------------------------------------------------------------------- /Docs/Get-HuduAppInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduAppInfo 9 | 10 | ## SYNOPSIS 11 | Retrieve information regarding API 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduAppInfo [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Calls Hudu API to retrieve version number and date 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduAppInfo 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | 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). 33 | 34 | ## INPUTS 35 | 36 | ## OUTPUTS 37 | 38 | ## NOTES 39 | 40 | ## RELATED LINKS 41 | -------------------------------------------------------------------------------- /Docs/Get-HuduArticles.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduArticles 9 | 10 | ## SYNOPSIS 11 | Get Knowledge Base Articles 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduArticles [[-Id] ] [[-CompanyId] ] [[-Name] ] [[-Slug] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to retrieve KB articles by Id or a list 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduArticles -Name 'Article name' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of the Article 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -CompanyId 48 | Filter by company id 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: company_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Name 63 | Filter by name of article 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Slug 78 | Filter by slug of article 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Get-HuduAssetLayoutFieldID.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduAssetLayoutFieldID 9 | 10 | ## SYNOPSIS 11 | Get Hudu Asset Layout Field ID 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduAssetLayoutFieldID [-Name] [-LayoutId] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Retrieves ID for Hudu Asset Layout Fields 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduAssetLayoutFieldID -Name 'Extra Info' -LayoutId 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Name 32 | Name of Field 33 | 34 | ```yaml 35 | Type: String 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: None 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -LayoutId 47 | Asset Layout Id 48 | 49 | ```yaml 50 | Type: Int32 51 | Parameter Sets: (All) 52 | Aliases: asset_layout_id 53 | 54 | Required: True 55 | Position: 2 56 | Default value: 0 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### CommonParameters 62 | 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). 63 | 64 | ## INPUTS 65 | 66 | ## OUTPUTS 67 | 68 | ## NOTES 69 | 70 | ## RELATED LINKS 71 | -------------------------------------------------------------------------------- /Docs/Get-HuduAssetLayouts.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduAssetLayouts 9 | 10 | ## SYNOPSIS 11 | Get a list of Asset Layouts 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduAssetLayouts [[-Name] ] [[-LayoutId] ] [[-Slug] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Call Hudu API to retrieve asset layouts for server 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduAssetLayouts -Name 'Contacts' 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Name 32 | Filter by name of Asset Layout 33 | 34 | ```yaml 35 | Type: String 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: False 40 | Position: 1 41 | Default value: None 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -LayoutId 47 | Id of Asset Layout 48 | 49 | ```yaml 50 | Type: Int32 51 | Parameter Sets: (All) 52 | Aliases: id, layout_id 53 | 54 | Required: False 55 | Position: 2 56 | Default value: 0 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -Slug 62 | Filter by url slug 63 | 64 | ```yaml 65 | Type: String 66 | Parameter Sets: (All) 67 | Aliases: 68 | 69 | Required: False 70 | Position: 3 71 | Default value: None 72 | Accept pipeline input: False 73 | Accept wildcard characters: False 74 | ``` 75 | 76 | ### CommonParameters 77 | 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). 78 | 79 | ## INPUTS 80 | 81 | ## OUTPUTS 82 | 83 | ## NOTES 84 | 85 | ## RELATED LINKS 86 | -------------------------------------------------------------------------------- /Docs/Get-HuduAssets.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduAssets 9 | 10 | ## SYNOPSIS 11 | Get a list of Assets 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduAssets [[-Id] ] [[-AssetLayoutId] ] [[-AssetLayout] ] [[-CompanyId] ] 17 | [[-Name] ] [-Archived] [[-PrimarySerial] ] [[-Slug] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Call Hudu API to retrieve Assets 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduAssets -AssetLayout 'Contacts' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of requested asset 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -AssetLayoutId 48 | Id of the requested asset layout 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: asset_layout_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -AssetLayout 63 | Name of the requested asset layout 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -CompanyId 78 | Id of the requested company 79 | 80 | ```yaml 81 | Type: Int32 82 | Parameter Sets: (All) 83 | Aliases: company_id 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -Name 93 | Filter by name 94 | 95 | ```yaml 96 | Type: String 97 | Parameter Sets: (All) 98 | Aliases: 99 | 100 | Required: False 101 | Position: 5 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -Archived 108 | Show archived results 109 | 110 | ```yaml 111 | Type: SwitchParameter 112 | Parameter Sets: (All) 113 | Aliases: 114 | 115 | Required: False 116 | Position: Named 117 | Default value: False 118 | Accept pipeline input: False 119 | Accept wildcard characters: False 120 | ``` 121 | 122 | ### -PrimarySerial 123 | Filter by primary serial 124 | 125 | ```yaml 126 | Type: String 127 | Parameter Sets: (All) 128 | Aliases: primary_serial 129 | 130 | Required: False 131 | Position: 6 132 | Default value: None 133 | Accept pipeline input: False 134 | Accept wildcard characters: False 135 | ``` 136 | 137 | ### -Slug 138 | Filter by slug 139 | 140 | ```yaml 141 | Type: String 142 | Parameter Sets: (All) 143 | Aliases: 144 | 145 | Required: False 146 | Position: 7 147 | Default value: None 148 | Accept pipeline input: False 149 | Accept wildcard characters: False 150 | ``` 151 | 152 | ### CommonParameters 153 | 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). 154 | 155 | ## INPUTS 156 | 157 | ## OUTPUTS 158 | 159 | ## NOTES 160 | 161 | ## RELATED LINKS 162 | -------------------------------------------------------------------------------- /Docs/Get-HuduBaseURL.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduBaseURL 9 | 10 | ## SYNOPSIS 11 | Get Hudu Base URL 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduBaseURL [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Returns Hudu Base URL 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduBaseURL 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | 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). 33 | 34 | ## INPUTS 35 | 36 | ## OUTPUTS 37 | 38 | ## NOTES 39 | 40 | ## RELATED LINKS 41 | -------------------------------------------------------------------------------- /Docs/Get-HuduCard.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduCard 9 | 10 | ## SYNOPSIS 11 | Get Integration Cards 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduCard [-IntegrationSlug] [[-IntegrationId] ] [[-IntegrationIdentifier] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Lookup cards with outside integration details 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduCard -IntegrationSlug cw_manage -IntegrationId 1 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -IntegrationSlug 33 | Identifier of outside integration 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: integration_slug 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -IntegrationId 48 | ID in the integration. 49 | Must be present, unless integration_identifier is set 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: integration_id 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -IntegrationIdentifier 64 | Identifier in the integration (if integration_id is not set) 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: integration_identifier 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | 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). 80 | 81 | ## INPUTS 82 | 83 | ## OUTPUTS 84 | 85 | ## NOTES 86 | 87 | ## RELATED LINKS 88 | -------------------------------------------------------------------------------- /Docs/Get-HuduCompanies.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduCompanies 9 | 10 | ## SYNOPSIS 11 | Get a list of companies 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduCompanies [[-Name] ] [[-PhoneNumber] ] [[-Website] ] [[-City] ] 17 | [[-State] ] [[-IdInIntegration] ] [[-Id] ] [[-Search] ] [[-Slug] ] 18 | [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Call Hudu API to retrieve company list 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Get-HuduCompanies -Search 'Vendor' 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -Name 34 | Filter companies by name 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -PhoneNumber 49 | filter companies by phone number 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: phone_number 55 | 56 | Required: False 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -Website 64 | Filter companies by website 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -City 79 | Filter companies by city 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -State 94 | Filter companies by state 95 | 96 | ```yaml 97 | Type: String 98 | Parameter Sets: (All) 99 | Aliases: 100 | 101 | Required: False 102 | Position: 5 103 | Default value: None 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### -IdInIntegration 109 | Filter companies by id/identifier in PSA/RMM/outside integration 110 | 111 | ```yaml 112 | Type: Int32 113 | Parameter Sets: (All) 114 | Aliases: id_in_integration 115 | 116 | Required: False 117 | Position: 6 118 | Default value: None 119 | Accept pipeline input: False 120 | Accept wildcard characters: False 121 | ``` 122 | 123 | ### -Id 124 | Filter companies by id 125 | 126 | ```yaml 127 | Type: Int32 128 | Parameter Sets: (All) 129 | Aliases: 130 | 131 | Required: False 132 | Position: 7 133 | Default value: None 134 | Accept pipeline input: False 135 | Accept wildcard characters: False 136 | ``` 137 | 138 | ### -Search 139 | Filter by search query 140 | 141 | ```yaml 142 | Type: String 143 | Parameter Sets: (All) 144 | Aliases: 145 | 146 | Required: False 147 | Position: 8 148 | Default value: None 149 | Accept pipeline input: False 150 | Accept wildcard characters: False 151 | ``` 152 | 153 | ### -Slug 154 | Filter by url slug 155 | 156 | ```yaml 157 | Type: String 158 | Parameter Sets: (All) 159 | Aliases: 160 | 161 | Required: False 162 | Position: 9 163 | Default value: None 164 | Accept pipeline input: False 165 | Accept wildcard characters: False 166 | ``` 167 | 168 | ### CommonParameters 169 | 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). 170 | 171 | ## INPUTS 172 | 173 | ## OUTPUTS 174 | 175 | ## NOTES 176 | 177 | ## RELATED LINKS 178 | -------------------------------------------------------------------------------- /Docs/Get-HuduExpirations.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduExpirations 9 | 10 | ## SYNOPSIS 11 | Get expirations for account 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduExpirations [[-CompanyId] ] [[-ExpirationType] ] [[-ResourceId] ] 17 | [[-ResourceType] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to retrieve expirations 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduExpirations -ExpirationType domain 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -CompanyId 33 | Filter expirations by company_id 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: company_id 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -ExpirationType 48 | Filter expirations by expiration type (undeclared, domain, ssl_certificate, warranty, asset_field, article_expiration) 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: expiration_type 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -ResourceId 63 | Filter logs by resource id. 64 | Must be coupled with resource_type 65 | 66 | ```yaml 67 | Type: Int32 68 | Parameter Sets: (All) 69 | Aliases: resource_id 70 | 71 | Required: False 72 | Position: 3 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -ResourceType 79 | Filter logs by resource type (Asset, AssetPassword, Company, Article, etc.). 80 | Must be coupled with resource_id 81 | 82 | ```yaml 83 | Type: String 84 | Parameter Sets: (All) 85 | Aliases: resource_type 86 | 87 | Required: False 88 | Position: 4 89 | Default value: None 90 | Accept pipeline input: False 91 | Accept wildcard characters: False 92 | ``` 93 | 94 | ### CommonParameters 95 | 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). 96 | 97 | ## INPUTS 98 | 99 | ## OUTPUTS 100 | 101 | ## NOTES 102 | 103 | ## RELATED LINKS 104 | -------------------------------------------------------------------------------- /Docs/Get-HuduFolderMap.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduFolderMap 9 | 10 | ## SYNOPSIS 11 | {{ Fill in the Synopsis }} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduFolderMap [[-CompanyId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{ Fill in the Description }} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -CompanyId 34 | {{ Fill CompanyId Description }} 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: company_id 40 | 41 | Required: False 42 | Position: 0 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### CommonParameters 49 | 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). 50 | 51 | ## INPUTS 52 | 53 | ### None 54 | 55 | ## OUTPUTS 56 | 57 | ### System.Object 58 | ## NOTES 59 | 60 | ## RELATED LINKS 61 | -------------------------------------------------------------------------------- /Docs/Get-HuduFolders.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduFolders 9 | 10 | ## SYNOPSIS 11 | Get a list of Folders 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduFolders [[-Id] ] [[-Name] ] [[-CompanyId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Calls Hudu API to retrieve folders 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduFolders 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the folder 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: False 40 | Position: 1 41 | Default value: None 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -Name 47 | Filter by name 48 | 49 | ```yaml 50 | Type: String 51 | Parameter Sets: (All) 52 | Aliases: 53 | 54 | Required: False 55 | Position: 2 56 | Default value: None 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -CompanyId 62 | Filter by company_id 63 | 64 | ```yaml 65 | Type: Int32 66 | Parameter Sets: (All) 67 | Aliases: company_id 68 | 69 | Required: False 70 | Position: 3 71 | Default value: None 72 | Accept pipeline input: False 73 | Accept wildcard characters: False 74 | ``` 75 | 76 | ### CommonParameters 77 | 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). 78 | 79 | ## INPUTS 80 | 81 | ## OUTPUTS 82 | 83 | ## NOTES 84 | 85 | ## RELATED LINKS 86 | -------------------------------------------------------------------------------- /Docs/Get-HuduIntegrationMatchers.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduIntegrationMatchers 9 | 10 | ## SYNOPSIS 11 | List matchers for an integration 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduIntegrationMatchers [-IntegrationId] [-Matched] [[-SyncId] ] [[-Identifier] ] 17 | [[-CompanyId] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to get list of integration matching 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduIntegrationMatchers -IntegrationId 1 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -IntegrationId 33 | ID of the integration. 34 | Can be found in the URL when editing an integration 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: 0 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -Matched 49 | Filter on whether the company already been matched 50 | 51 | ```yaml 52 | Type: SwitchParameter 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: Named 58 | Default value: False 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -SyncId 64 | Filter by ID of the record in the integration. 65 | This is used if the id that the integration uses is an integer. 66 | 67 | ```yaml 68 | Type: Int32 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 2 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -Identifier 80 | Filter by Identifier in the integration (if sync_id is not set). 81 | This is used if the id that the integration uses is a string. 82 | 83 | ```yaml 84 | Type: String 85 | Parameter Sets: (All) 86 | Aliases: 87 | 88 | Required: False 89 | Position: 3 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -CompanyId 96 | Filter on company id 97 | 98 | ```yaml 99 | Type: Int32 100 | Parameter Sets: (All) 101 | Aliases: 102 | 103 | Required: False 104 | Position: 4 105 | Default value: 0 106 | Accept pipeline input: False 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### CommonParameters 111 | 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). 112 | 113 | ## INPUTS 114 | 115 | ## OUTPUTS 116 | 117 | ## NOTES 118 | 119 | ## RELATED LINKS 120 | -------------------------------------------------------------------------------- /Docs/Get-HuduMagicDashes.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduMagicDashes 9 | 10 | ## SYNOPSIS 11 | Get all Magic Dash Items 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduMagicDashes [[-CompanyId] ] [[-Title] ] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Call Hudu API to retrieve Magic Dashes 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduMagicDashes -Title 'Microsoft 365 - ...' 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -CompanyId 32 | Filter by company id 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: company_id 38 | 39 | Required: False 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -Title 47 | Filter by title 48 | 49 | ```yaml 50 | Type: String 51 | Parameter Sets: (All) 52 | Aliases: 53 | 54 | Required: False 55 | Position: 2 56 | Default value: None 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ## INPUTS 62 | 63 | ## OUTPUTS 64 | 65 | ## NOTES 66 | 67 | ## RELATED LINKS 68 | -------------------------------------------------------------------------------- /Docs/Get-HuduObjectByUrl.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduObjectByUrl 9 | 10 | ## SYNOPSIS 11 | Get Hudu object from URL 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduObjectByUrl [[-Url] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Calls Hudu API to retrieve object based on URL string 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduObject -Url https://your-hudu-server/a/some-asset-1z8z7a 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Url 32 | Url to retrieve object from 33 | 34 | ```yaml 35 | Type: Uri 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: False 40 | Position: 1 41 | Default value: None 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### CommonParameters 47 | 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). 48 | 49 | ## INPUTS 50 | 51 | ## OUTPUTS 52 | 53 | ## NOTES 54 | 55 | ## RELATED LINKS 56 | -------------------------------------------------------------------------------- /Docs/Get-HuduPasswords.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduPasswords 9 | 10 | ## SYNOPSIS 11 | Get a list of Passwords 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduPasswords [[-Id] ] [[-CompanyId] ] [[-Name] ] [[-Slug] ] 17 | [[-Search] ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to list password assets 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduPasswords -CompanyId 1 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of the password 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: 0 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -CompanyId 48 | Filter by company id 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: company_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: 0 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Name 63 | Filter by password name 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Slug 78 | Filter by url slug 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -Search 93 | Filter by search query 94 | 95 | ```yaml 96 | Type: String 97 | Parameter Sets: (All) 98 | Aliases: 99 | 100 | Required: False 101 | Position: 5 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### CommonParameters 108 | 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). 109 | 110 | ## INPUTS 111 | 112 | ## OUTPUTS 113 | 114 | ## NOTES 115 | 116 | ## RELATED LINKS 117 | -------------------------------------------------------------------------------- /Docs/Get-HuduProcesses.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduProcesses 9 | 10 | ## SYNOPSIS 11 | Get a list of Procedures (Processes) 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduProcesses [[-Id] ] [[-CompanyId] ] [[-Name] ] [[-Slug] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to retrieve list of procedures 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduProcedures -Name 'Procedure 1' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of the Procedure 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -CompanyId 48 | Filter by company id 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: company_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Name 63 | Fitler by name of article 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Slug 78 | Filter by url slug 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Get-HuduPublicPhotos.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduPublicPhotos 9 | 10 | ## SYNOPSIS 11 | Get a list of Public_Photos 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduPublicPhotos [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Calls Hudu API to retrieve public photos 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduPublicPhotos 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | 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). 33 | 34 | ## INPUTS 35 | 36 | ## OUTPUTS 37 | 38 | ## NOTES 39 | 40 | ## RELATED LINKS 41 | -------------------------------------------------------------------------------- /Docs/Get-HuduRelations.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduRelations 9 | 10 | ## SYNOPSIS 11 | Get a list of all relations 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduRelations [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Calls Hudu API to retrieve object relationsihps 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-HuduRelations -CompanyId 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### CommonParameters 32 | 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). 33 | 34 | ## INPUTS 35 | 36 | ## OUTPUTS 37 | 38 | ## NOTES 39 | 40 | ## RELATED LINKS 41 | -------------------------------------------------------------------------------- /Docs/Get-HuduWebsites.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-HuduWebsites 9 | 10 | ## SYNOPSIS 11 | Get a list of all websites 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-HuduWebsites [[-Name] ] [[-WebsiteId] ] [[-Slug] ] [[-Search] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Calls Hudu API to get websites 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Get-HuduWebsites -Search 'domain.com' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Name 33 | Filter websites by name 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -WebsiteId 48 | {{ Fill WebsiteId Description }} 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: website_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: 0 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Slug 63 | Filter by url slug 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Search 78 | Fitler by search query 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Initialize-HuduFolder.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Initialize-HuduFolder 9 | 10 | ## SYNOPSIS 11 | {{ Fill in the Synopsis }} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Initialize-HuduFolder [[-FolderPath] ] [[-CompanyId] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{ Fill in the Description }} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -CompanyId 34 | {{ Fill CompanyId Description }} 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: company_id 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -FolderPath 49 | {{ Fill FolderPath Description }} 50 | 51 | ```yaml 52 | Type: String[] 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 0 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### CommonParameters 64 | 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). 65 | 66 | ## INPUTS 67 | 68 | ### None 69 | 70 | ## OUTPUTS 71 | 72 | ### System.Object 73 | ## NOTES 74 | 75 | ## RELATED LINKS 76 | -------------------------------------------------------------------------------- /Docs/New-HuduAPIKey.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduAPIKey 9 | 10 | ## SYNOPSIS 11 | Set Hudu API Key 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduAPIKey [[-ApiKey] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | API keys are required to interact with Hudu 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-HuduAPIKey -ApiKey abdc1234 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -ApiKey 32 | The API key 33 | 34 | ```yaml 35 | Type: String 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: False 40 | Position: 1 41 | Default value: None 42 | Accept pipeline input: True (ByValue) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### CommonParameters 47 | 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). 48 | 49 | ## INPUTS 50 | 51 | ## OUTPUTS 52 | 53 | ## NOTES 54 | 55 | ## RELATED LINKS 56 | -------------------------------------------------------------------------------- /Docs/New-HuduArticle.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduArticle 9 | 10 | ## SYNOPSIS 11 | Create a Knowledge Base Article 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduArticle [-Name] [-Content] [-EnableSharing] [[-FolderId] ] 17 | [[-CompanyId] ] [[-Slug] ] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to create KB articles 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Testing' -EnableSharing -Slug 'this-is-a-test' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Name 33 | Name of article 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Content 48 | Article HTML contents 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: True 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -EnableSharing 63 | Create public URL for users to view without being authenticated 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: Named 72 | Default value: False 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -FolderId 78 | Associate article with folder id 79 | 80 | ```yaml 81 | Type: Int32 82 | Parameter Sets: (All) 83 | Aliases: folder_id 84 | 85 | Required: False 86 | Position: 3 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -CompanyId 93 | Associate article with company id 94 | 95 | ```yaml 96 | Type: Int32 97 | Parameter Sets: (All) 98 | Aliases: company_id 99 | 100 | Required: False 101 | Position: 4 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -Slug 108 | Manually define slug for Article 109 | 110 | ```yaml 111 | Type: String 112 | Parameter Sets: (All) 113 | Aliases: 114 | 115 | Required: False 116 | Position: 5 117 | Default value: None 118 | Accept pipeline input: False 119 | Accept wildcard characters: False 120 | ``` 121 | 122 | ### -WhatIf 123 | Shows what would happen if the cmdlet runs. 124 | The cmdlet is not run. 125 | 126 | ```yaml 127 | Type: SwitchParameter 128 | Parameter Sets: (All) 129 | Aliases: wi 130 | 131 | Required: False 132 | Position: Named 133 | Default value: None 134 | Accept pipeline input: False 135 | Accept wildcard characters: False 136 | ``` 137 | 138 | ### -Confirm 139 | Prompts you for confirmation before running the cmdlet. 140 | 141 | ```yaml 142 | Type: SwitchParameter 143 | Parameter Sets: (All) 144 | Aliases: cf 145 | 146 | Required: False 147 | Position: Named 148 | Default value: None 149 | Accept pipeline input: False 150 | Accept wildcard characters: False 151 | ``` 152 | 153 | ### CommonParameters 154 | 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). 155 | 156 | ## INPUTS 157 | 158 | ## OUTPUTS 159 | 160 | ## NOTES 161 | 162 | ## RELATED LINKS 163 | -------------------------------------------------------------------------------- /Docs/New-HuduAsset.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduAsset 9 | 10 | ## SYNOPSIS 11 | Create an Asset 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduAsset [-Name] [-CompanyId] [-AssetLayoutId] [[-Fields] ] 17 | [[-PrimarySerial] ] [[-PrimaryMail] ] [[-PrimaryModel] ] 18 | [[-PrimaryManufacturer] ] [-WhatIf] [-Confirm] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Uses Hudu API to create assets using custom layouts 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | New-HuduAsset -Name 'Some asset' -CompanyId 1 -Fields @(@{'field_name'='Field Value'}) 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -Name 34 | Name of the Asset 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -CompanyId 49 | Company id for asset 50 | 51 | ```yaml 52 | Type: Int32 53 | Parameter Sets: (All) 54 | Aliases: company_id 55 | 56 | Required: True 57 | Position: 2 58 | Default value: 0 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -AssetLayoutId 64 | Asset layout id 65 | 66 | ```yaml 67 | Type: Int32 68 | Parameter Sets: (All) 69 | Aliases: asset_layout_id 70 | 71 | Required: True 72 | Position: 3 73 | Default value: 0 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -Fields 79 | Array of custom fields and values 80 | 81 | ```yaml 82 | Type: Array 83 | Parameter Sets: (All) 84 | Aliases: 85 | 86 | Required: False 87 | Position: 4 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -PrimarySerial 94 | Asset primary serial number 95 | 96 | ```yaml 97 | Type: String 98 | Parameter Sets: (All) 99 | Aliases: primary_serial 100 | 101 | Required: False 102 | Position: 5 103 | Default value: None 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### -PrimaryMail 109 | Asset primary mail 110 | 111 | ```yaml 112 | Type: String 113 | Parameter Sets: (All) 114 | Aliases: primary_mail 115 | 116 | Required: False 117 | Position: 6 118 | Default value: None 119 | Accept pipeline input: False 120 | Accept wildcard characters: False 121 | ``` 122 | 123 | ### -PrimaryModel 124 | Asset primary model 125 | 126 | ```yaml 127 | Type: String 128 | Parameter Sets: (All) 129 | Aliases: primary_model 130 | 131 | Required: False 132 | Position: 7 133 | Default value: None 134 | Accept pipeline input: False 135 | Accept wildcard characters: False 136 | ``` 137 | 138 | ### -PrimaryManufacturer 139 | Asset primary manufacturer 140 | 141 | ```yaml 142 | Type: String 143 | Parameter Sets: (All) 144 | Aliases: primary_manufacturer 145 | 146 | Required: False 147 | Position: 8 148 | Default value: None 149 | Accept pipeline input: False 150 | Accept wildcard characters: False 151 | ``` 152 | 153 | ### -WhatIf 154 | Shows what would happen if the cmdlet runs. 155 | The cmdlet is not run. 156 | 157 | ```yaml 158 | Type: SwitchParameter 159 | Parameter Sets: (All) 160 | Aliases: wi 161 | 162 | Required: False 163 | Position: Named 164 | Default value: None 165 | Accept pipeline input: False 166 | Accept wildcard characters: False 167 | ``` 168 | 169 | ### -Confirm 170 | Prompts you for confirmation before running the cmdlet. 171 | 172 | ```yaml 173 | Type: SwitchParameter 174 | Parameter Sets: (All) 175 | Aliases: cf 176 | 177 | Required: False 178 | Position: Named 179 | Default value: None 180 | Accept pipeline input: False 181 | Accept wildcard characters: False 182 | ``` 183 | 184 | ### CommonParameters 185 | 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). 186 | 187 | ## INPUTS 188 | 189 | ## OUTPUTS 190 | 191 | ## NOTES 192 | 193 | ## RELATED LINKS 194 | -------------------------------------------------------------------------------- /Docs/New-HuduBaseURL.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduBaseURL 9 | 10 | ## SYNOPSIS 11 | Set Hudu Base URL 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduBaseURL [[-BaseURL] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | In order to access the Hudu API the Base URL must be set 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-HuduBaseURL -BaseURL https://demo.huducloud.com 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -BaseURL 32 | Url with no trailing slash e.g. 33 | https://demo.huducloud.com 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: False 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: True (ByValue) 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### CommonParameters 48 | 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). 49 | 50 | ## INPUTS 51 | 52 | ## OUTPUTS 53 | 54 | ## NOTES 55 | General notes 56 | 57 | ## RELATED LINKS 58 | -------------------------------------------------------------------------------- /Docs/New-HuduFolder.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduFolder 9 | 10 | ## SYNOPSIS 11 | Create a Folder 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduFolder [-Name] [[-Icon] ] [[-Description] ] [[-ParentFolderId] ] 17 | [[-CompanyId] ] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to create a new folder 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | New-HuduFolder -Name 'Test folder' -CompanyId 1 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Name 33 | Name of the folder 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Icon 48 | Folder Icon 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: False 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Description 63 | Folder description 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -ParentFolderId 78 | Parent folder ID 79 | 80 | ```yaml 81 | Type: Int32 82 | Parameter Sets: (All) 83 | Aliases: parent_folder_id 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -CompanyId 93 | Company id 94 | 95 | ```yaml 96 | Type: Int32 97 | Parameter Sets: (All) 98 | Aliases: company_id 99 | 100 | Required: False 101 | Position: 5 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -WhatIf 108 | Shows what would happen if the cmdlet runs. 109 | The cmdlet is not run. 110 | 111 | ```yaml 112 | Type: SwitchParameter 113 | Parameter Sets: (All) 114 | Aliases: wi 115 | 116 | Required: False 117 | Position: Named 118 | Default value: None 119 | Accept pipeline input: False 120 | Accept wildcard characters: False 121 | ``` 122 | 123 | ### -Confirm 124 | Prompts you for confirmation before running the cmdlet. 125 | 126 | ```yaml 127 | Type: SwitchParameter 128 | Parameter Sets: (All) 129 | Aliases: cf 130 | 131 | Required: False 132 | Position: Named 133 | Default value: None 134 | Accept pipeline input: False 135 | Accept wildcard characters: False 136 | ``` 137 | 138 | ### CommonParameters 139 | 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). 140 | 141 | ## INPUTS 142 | 143 | ## OUTPUTS 144 | 145 | ## NOTES 146 | 147 | ## RELATED LINKS 148 | -------------------------------------------------------------------------------- /Docs/New-HuduPublicPhoto.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduPublicPhoto 9 | 10 | ## SYNOPSIS 11 | Create a Public Photo 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduPublicPhoto [-FilePath] [[-RecordId] ] [[-RecordType] ] [-WhatIf] [-Confirm] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to upload an image for use in an asset or article 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | New-HuduPublicPhoto -FilePath 'c:\path\to\image.png' -RecordId 1 -RecordType 'asset' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -FilePath 33 | Path to the image 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -RecordId 48 | Record id to associate with the photo 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: record_id 54 | 55 | Required: False 56 | Position: 2 57 | Default value: 0 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -RecordType 63 | Record type to associate with the photo 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: record_type 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -WhatIf 78 | Shows what would happen if the cmdlet runs. 79 | The cmdlet is not run. 80 | 81 | ```yaml 82 | Type: SwitchParameter 83 | Parameter Sets: (All) 84 | Aliases: wi 85 | 86 | Required: False 87 | Position: Named 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -Confirm 94 | Prompts you for confirmation before running the cmdlet. 95 | 96 | ```yaml 97 | Type: SwitchParameter 98 | Parameter Sets: (All) 99 | Aliases: cf 100 | 101 | Required: False 102 | Position: Named 103 | Default value: None 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### CommonParameters 109 | 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). 110 | 111 | ## INPUTS 112 | 113 | ## OUTPUTS 114 | 115 | ## NOTES 116 | 117 | ## RELATED LINKS 118 | -------------------------------------------------------------------------------- /Docs/New-HuduRelation.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduRelation 9 | 10 | ## SYNOPSIS 11 | Create a Relation 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduRelation [[-Description] ] [-FromableType] [[-FromableID] ] 17 | [[-ToableType] ] [[-ToableID] ] [[-IsInverse] ] [-WhatIf] [-Confirm] 18 | [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Uses Hudu API to create relationships between objects 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | An example 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -Description 34 | Give a description to the relation so you know why two things are related 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -FromableType 49 | The type of the FROM relation (Asset, Website, Procedure, AssetPassword, Company, Article) 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: fromable_type 55 | 56 | Required: True 57 | Position: 2 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -FromableID 64 | The ID of the FROM relation 65 | 66 | ```yaml 67 | Type: Int32 68 | Parameter Sets: (All) 69 | Aliases: fromable_id 70 | 71 | Required: False 72 | Position: 3 73 | Default value: 0 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### -ToableType 79 | The type of the TO relation (Asset, Website, Procedure, AssetPassword, Company, Article) 80 | 81 | ```yaml 82 | Type: String 83 | Parameter Sets: (All) 84 | Aliases: toable_type 85 | 86 | Required: False 87 | Position: 4 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -ToableID 94 | The ID of the TO relation 95 | 96 | ```yaml 97 | Type: Int32 98 | Parameter Sets: (All) 99 | Aliases: toable_id 100 | 101 | Required: False 102 | Position: 5 103 | Default value: 0 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### -IsInverse 109 | When a relation is created, it will also create another relation that is the inverse. 110 | When this is true, this relation is the inverse. 111 | 112 | ```yaml 113 | Type: String 114 | Parameter Sets: (All) 115 | Aliases: is_inverse 116 | 117 | Required: False 118 | Position: 6 119 | Default value: None 120 | Accept pipeline input: False 121 | Accept wildcard characters: False 122 | ``` 123 | 124 | ### -WhatIf 125 | Shows what would happen if the cmdlet runs. 126 | The cmdlet is not run. 127 | 128 | ```yaml 129 | Type: SwitchParameter 130 | Parameter Sets: (All) 131 | Aliases: wi 132 | 133 | Required: False 134 | Position: Named 135 | Default value: None 136 | Accept pipeline input: False 137 | Accept wildcard characters: False 138 | ``` 139 | 140 | ### -Confirm 141 | Prompts you for confirmation before running the cmdlet. 142 | 143 | ```yaml 144 | Type: SwitchParameter 145 | Parameter Sets: (All) 146 | Aliases: cf 147 | 148 | Required: False 149 | Position: Named 150 | Default value: None 151 | Accept pipeline input: False 152 | Accept wildcard characters: False 153 | ``` 154 | 155 | ### CommonParameters 156 | 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). 157 | 158 | ## INPUTS 159 | 160 | ## OUTPUTS 161 | 162 | ## NOTES 163 | General notes 164 | 165 | ## RELATED LINKS 166 | -------------------------------------------------------------------------------- /Docs/New-HuduWebsite.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-HuduWebsite 9 | 10 | ## SYNOPSIS 11 | Create a Website 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-HuduWebsite [-Name] [[-Notes] ] [[-Paused] ] [-CompanyId] 17 | [[-DisableDNS] ] [[-DisableSSL] ] [[-DisableWhois] ] [[-Slug] ] [-WhatIf] 18 | [-Confirm] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Uses Hudu API to create a website 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | New-HuduWebsite -CompanyId 1 -Name https://domain.com 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -Name 34 | Website name (e.g. 35 | https://domain.com) 36 | 37 | ```yaml 38 | Type: String 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: True 43 | Position: 1 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -Notes 50 | Used to add additional notes to a website 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: False 58 | Position: 2 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -Paused 65 | When true, website monitoring is paused 66 | 67 | ```yaml 68 | Type: String 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -CompanyId 80 | Used to associate website with company 81 | 82 | ```yaml 83 | Type: Int32 84 | Parameter Sets: (All) 85 | Aliases: company_id 86 | 87 | Required: True 88 | Position: 4 89 | Default value: 0 90 | Accept pipeline input: False 91 | Accept wildcard characters: False 92 | ``` 93 | 94 | ### -DisableDNS 95 | When true, dns monitoring is paused. 96 | 97 | ```yaml 98 | Type: String 99 | Parameter Sets: (All) 100 | Aliases: disable_dns 101 | 102 | Required: False 103 | Position: 5 104 | Default value: None 105 | Accept pipeline input: False 106 | Accept wildcard characters: False 107 | ``` 108 | 109 | ### -DisableSSL 110 | When true, ssl cert monitoring is paused. 111 | 112 | ```yaml 113 | Type: String 114 | Parameter Sets: (All) 115 | Aliases: disable_ssl 116 | 117 | Required: False 118 | Position: 6 119 | Default value: None 120 | Accept pipeline input: False 121 | Accept wildcard characters: False 122 | ``` 123 | 124 | ### -DisableWhois 125 | When true, whois monitoring is paused. 126 | 127 | ```yaml 128 | Type: String 129 | Parameter Sets: (All) 130 | Aliases: disable_whois 131 | 132 | Required: False 133 | Position: 7 134 | Default value: None 135 | Accept pipeline input: False 136 | Accept wildcard characters: False 137 | ``` 138 | 139 | ### -Slug 140 | Url identifier 141 | 142 | ```yaml 143 | Type: String 144 | Parameter Sets: (All) 145 | Aliases: 146 | 147 | Required: False 148 | Position: 8 149 | Default value: None 150 | Accept pipeline input: False 151 | Accept wildcard characters: False 152 | ``` 153 | 154 | ### -WhatIf 155 | Shows what would happen if the cmdlet runs. 156 | The cmdlet is not run. 157 | 158 | ```yaml 159 | Type: SwitchParameter 160 | Parameter Sets: (All) 161 | Aliases: wi 162 | 163 | Required: False 164 | Position: Named 165 | Default value: None 166 | Accept pipeline input: False 167 | Accept wildcard characters: False 168 | ``` 169 | 170 | ### -Confirm 171 | Prompts you for confirmation before running the cmdlet. 172 | 173 | ```yaml 174 | Type: SwitchParameter 175 | Parameter Sets: (All) 176 | Aliases: cf 177 | 178 | Required: False 179 | Position: Named 180 | Default value: None 181 | Accept pipeline input: False 182 | Accept wildcard characters: False 183 | ``` 184 | 185 | ### CommonParameters 186 | 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). 187 | 188 | ## INPUTS 189 | 190 | ## OUTPUTS 191 | 192 | ## NOTES 193 | 194 | ## RELATED LINKS 195 | -------------------------------------------------------------------------------- /Docs/Remove-HuduAPIKey.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduAPIKey 9 | 10 | ## SYNOPSIS 11 | Remove API key 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduAPIKey [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Unsets the variable for the Hudu API Key 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduAPIKey 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -WhatIf 32 | Shows what would happen if the cmdlet runs. 33 | The cmdlet is not run. 34 | 35 | ```yaml 36 | Type: SwitchParameter 37 | Parameter Sets: (All) 38 | Aliases: wi 39 | 40 | Required: False 41 | Position: Named 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Confirm 48 | Prompts you for confirmation before running the cmdlet. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: cf 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | 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). 64 | 65 | ## INPUTS 66 | 67 | ## OUTPUTS 68 | 69 | ## NOTES 70 | 71 | ## RELATED LINKS 72 | -------------------------------------------------------------------------------- /Docs/Remove-HuduArticle.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduArticle 9 | 10 | ## SYNOPSIS 11 | Delete a Knowledge Base Article 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduArticle [-Id] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to remove a KB article 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduArticle -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested article 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -WhatIf 47 | Shows what would happen if the cmdlet runs. 48 | The cmdlet is not run. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: wi 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Confirm 63 | Prompts you for confirmation before running the cmdlet. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: cf 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### CommonParameters 78 | 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). 79 | 80 | ## INPUTS 81 | 82 | ## OUTPUTS 83 | 84 | ## NOTES 85 | General notes 86 | 87 | ## RELATED LINKS 88 | -------------------------------------------------------------------------------- /Docs/Remove-HuduAsset.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduAsset 9 | 10 | ## SYNOPSIS 11 | Delete an Asset 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduAsset [-Id] [-CompanyId] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to remove an Asset from a company 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduAsset -CompanyId 1 -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested Asset 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -CompanyId 47 | Id of the requested parent Company 48 | 49 | ```yaml 50 | Type: Int32 51 | Parameter Sets: (All) 52 | Aliases: company_id 53 | 54 | Required: True 55 | Position: 2 56 | Default value: 0 57 | Accept pipeline input: True (ByPropertyName) 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -WhatIf 62 | Shows what would happen if the cmdlet runs. 63 | The cmdlet is not run. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: wi 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Confirm 78 | Prompts you for confirmation before running the cmdlet. 79 | 80 | ```yaml 81 | Type: SwitchParameter 82 | Parameter Sets: (All) 83 | Aliases: cf 84 | 85 | Required: False 86 | Position: Named 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Remove-HuduBaseURL.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduBaseURL 9 | 10 | ## SYNOPSIS 11 | Remove base URL 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduBaseURL [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Unsets the Hudu Base URL variable 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduBaseURL 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -WhatIf 32 | Shows what would happen if the cmdlet runs. 33 | The cmdlet is not run. 34 | 35 | ```yaml 36 | Type: SwitchParameter 37 | Parameter Sets: (All) 38 | Aliases: wi 39 | 40 | Required: False 41 | Position: Named 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Confirm 48 | Prompts you for confirmation before running the cmdlet. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: cf 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### CommonParameters 63 | 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). 64 | 65 | ## INPUTS 66 | 67 | ## OUTPUTS 68 | 69 | ## NOTES 70 | 71 | ## RELATED LINKS 72 | -------------------------------------------------------------------------------- /Docs/Remove-HuduMagicDash.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduMagicDash 9 | 10 | ## SYNOPSIS 11 | Delete a Magic Dash Item 12 | 13 | ## SYNTAX 14 | 15 | ### Id (Default) 16 | ``` 17 | Remove-HuduMagicDash -Id [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ### TitleCompany 21 | ``` 22 | Remove-HuduMagicDash -Title -CompanyName [-WhatIf] [-Confirm] [] 23 | ``` 24 | 25 | ## DESCRIPTION 26 | Uses Hudu API to remove Magic Dash by Id or Title and Company Name 27 | 28 | ## EXAMPLES 29 | 30 | ### EXAMPLE 1 31 | ``` 32 | Remove-HuduMagicDash -Id 1 33 | ``` 34 | 35 | ### EXAMPLE 2 36 | ``` 37 | Remove-HuduMagicDash -Title 'Microsoft 365' -CompanyName 'AcmeCorp' 38 | ``` 39 | 40 | ## PARAMETERS 41 | 42 | ### -Title 43 | Title of the Magic Dash 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: TitleCompany 48 | Aliases: 49 | 50 | Required: True 51 | Position: Named 52 | Default value: None 53 | Accept pipeline input: True (ByPropertyName) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### -CompanyName 58 | Company Name 59 | 60 | ```yaml 61 | Type: String 62 | Parameter Sets: TitleCompany 63 | Aliases: company_name 64 | 65 | Required: True 66 | Position: Named 67 | Default value: None 68 | Accept pipeline input: True (ByPropertyName) 69 | Accept wildcard characters: False 70 | ``` 71 | 72 | ### -Id 73 | Id of the Magic Dash 74 | 75 | ```yaml 76 | Type: Int32 77 | Parameter Sets: Id 78 | Aliases: 79 | 80 | Required: True 81 | Position: Named 82 | Default value: 0 83 | Accept pipeline input: True (ByPropertyName) 84 | Accept wildcard characters: False 85 | ``` 86 | 87 | ### -WhatIf 88 | Shows what would happen if the cmdlet runs. 89 | The cmdlet is not run. 90 | 91 | ```yaml 92 | Type: SwitchParameter 93 | Parameter Sets: (All) 94 | Aliases: wi 95 | 96 | Required: False 97 | Position: Named 98 | Default value: None 99 | Accept pipeline input: False 100 | Accept wildcard characters: False 101 | ``` 102 | 103 | ### -Confirm 104 | Prompts you for confirmation before running the cmdlet. 105 | 106 | ```yaml 107 | Type: SwitchParameter 108 | Parameter Sets: (All) 109 | Aliases: cf 110 | 111 | Required: False 112 | Position: Named 113 | Default value: None 114 | Accept pipeline input: False 115 | Accept wildcard characters: False 116 | ``` 117 | 118 | ### CommonParameters 119 | 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). 120 | 121 | ## INPUTS 122 | 123 | ## OUTPUTS 124 | 125 | ## NOTES 126 | 127 | ## RELATED LINKS 128 | -------------------------------------------------------------------------------- /Docs/Remove-HuduPassword.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduPassword 9 | 10 | ## SYNOPSIS 11 | Delete a Password 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduPassword [-Id] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to remove asset password 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduPassword -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the password 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -WhatIf 47 | Shows what would happen if the cmdlet runs. 48 | The cmdlet is not run. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: wi 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Confirm 63 | Prompts you for confirmation before running the cmdlet. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: cf 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### CommonParameters 78 | 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). 79 | 80 | ## INPUTS 81 | 82 | ## OUTPUTS 83 | 84 | ## NOTES 85 | 86 | ## RELATED LINKS 87 | -------------------------------------------------------------------------------- /Docs/Remove-HuduRelation.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduRelation 9 | 10 | ## SYNOPSIS 11 | Delete a Relation 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduRelation [-Id] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to delete object relationships 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduRelation -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested Relation 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -WhatIf 47 | Shows what would happen if the cmdlet runs. 48 | The cmdlet is not run. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: wi 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Confirm 63 | Prompts you for confirmation before running the cmdlet. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: cf 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### CommonParameters 78 | 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). 79 | 80 | ## INPUTS 81 | 82 | ## OUTPUTS 83 | 84 | ## NOTES 85 | 86 | ## RELATED LINKS 87 | -------------------------------------------------------------------------------- /Docs/Remove-HuduWebsite.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-HuduWebsite 9 | 10 | ## SYNOPSIS 11 | Delete a Website 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-HuduWebsite [-Id] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to delete a website 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Remove-HuduWebsite -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested Website 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -WhatIf 47 | Shows what would happen if the cmdlet runs. 48 | The cmdlet is not run. 49 | 50 | ```yaml 51 | Type: SwitchParameter 52 | Parameter Sets: (All) 53 | Aliases: wi 54 | 55 | Required: False 56 | Position: Named 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Confirm 63 | Prompts you for confirmation before running the cmdlet. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: cf 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### CommonParameters 78 | 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). 79 | 80 | ## INPUTS 81 | 82 | ## OUTPUTS 83 | 84 | ## NOTES 85 | 86 | ## RELATED LINKS 87 | -------------------------------------------------------------------------------- /Docs/Set-HuduArticle.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduArticle 9 | 10 | ## SYNOPSIS 11 | Update a Knowledge Base Article 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduArticle [-Name] [-Content] [-EnableSharing] [[-FolderId] ] 17 | [[-CompanyId] ] [-ArticleId] [[-Slug] ] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to update KB Article 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | New article contents' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Name 33 | Name of the Article 34 | 35 | ```yaml 36 | Type: String 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: None 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Content 48 | Article Content 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: True 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -EnableSharing 63 | Set article to public and generate a URL 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: Named 72 | Default value: False 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -FolderId 78 | Used to associate article with folder 79 | 80 | ```yaml 81 | Type: Int32 82 | Parameter Sets: (All) 83 | Aliases: folder_id 84 | 85 | Required: False 86 | Position: 3 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -CompanyId 93 | Used to associate article with company 94 | 95 | ```yaml 96 | Type: Int32 97 | Parameter Sets: (All) 98 | Aliases: company_id 99 | 100 | Required: False 101 | Position: 4 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -ArticleId 108 | Id of the requested article 109 | 110 | ```yaml 111 | Type: Int32 112 | Parameter Sets: (All) 113 | Aliases: article_id, id 114 | 115 | Required: True 116 | Position: 5 117 | Default value: 0 118 | Accept pipeline input: False 119 | Accept wildcard characters: False 120 | ``` 121 | 122 | ### -Slug 123 | Url identifier 124 | 125 | ```yaml 126 | Type: String 127 | Parameter Sets: (All) 128 | Aliases: 129 | 130 | Required: False 131 | Position: 6 132 | Default value: None 133 | Accept pipeline input: False 134 | Accept wildcard characters: False 135 | ``` 136 | 137 | ### -WhatIf 138 | Shows what would happen if the cmdlet runs. 139 | The cmdlet is not run. 140 | 141 | ```yaml 142 | Type: SwitchParameter 143 | Parameter Sets: (All) 144 | Aliases: wi 145 | 146 | Required: False 147 | Position: Named 148 | Default value: None 149 | Accept pipeline input: False 150 | Accept wildcard characters: False 151 | ``` 152 | 153 | ### -Confirm 154 | Prompts you for confirmation before running the cmdlet. 155 | 156 | ```yaml 157 | Type: SwitchParameter 158 | Parameter Sets: (All) 159 | Aliases: cf 160 | 161 | Required: False 162 | Position: Named 163 | Default value: None 164 | Accept pipeline input: False 165 | Accept wildcard characters: False 166 | ``` 167 | 168 | ### CommonParameters 169 | 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). 170 | 171 | ## INPUTS 172 | 173 | ## OUTPUTS 174 | 175 | ## NOTES 176 | 177 | ## RELATED LINKS 178 | -------------------------------------------------------------------------------- /Docs/Set-HuduArticleArchive.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduArticleArchive 9 | 10 | ## SYNOPSIS 11 | Archive/Unarchive a Knowledge Base Article 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduArticleArchive [-Id] [-Archive] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to archive or unarchive an article 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Set-HuduArticleArchive -Id 1 -Archive $true 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested article 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -Archive 47 | Boolean for archive status 48 | 49 | ```yaml 50 | Type: Boolean 51 | Parameter Sets: (All) 52 | Aliases: 53 | 54 | Required: True 55 | Position: 2 56 | Default value: False 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -WhatIf 62 | Shows what would happen if the cmdlet runs. 63 | The cmdlet is not run. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: wi 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Confirm 78 | Prompts you for confirmation before running the cmdlet. 79 | 80 | ```yaml 81 | Type: SwitchParameter 82 | Parameter Sets: (All) 83 | Aliases: cf 84 | 85 | Required: False 86 | Position: Named 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Set-HuduAssetArchive.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduAssetArchive 9 | 10 | ## SYNOPSIS 11 | Archive/Unarchive an Asset 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduAssetArchive [-Id] [-CompanyId] [-Archive] [-WhatIf] [-Confirm] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to archive or unarchive an asset 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Set-HuduAssetArchive -Id 1 -CompanyId 1 -Archive $true 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of the requested Asset 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: 0 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -CompanyId 48 | Id of the requested parent company 49 | 50 | ```yaml 51 | Type: Int32 52 | Parameter Sets: (All) 53 | Aliases: company_id 54 | 55 | Required: True 56 | Position: 2 57 | Default value: 0 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Archive 63 | Boolean for archive status 64 | 65 | ```yaml 66 | Type: Boolean 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: True 71 | Position: 3 72 | Default value: False 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -WhatIf 78 | Shows what would happen if the cmdlet runs. 79 | The cmdlet is not run. 80 | 81 | ```yaml 82 | Type: SwitchParameter 83 | Parameter Sets: (All) 84 | Aliases: wi 85 | 86 | Required: False 87 | Position: Named 88 | Default value: None 89 | Accept pipeline input: False 90 | Accept wildcard characters: False 91 | ``` 92 | 93 | ### -Confirm 94 | Prompts you for confirmation before running the cmdlet. 95 | 96 | ```yaml 97 | Type: SwitchParameter 98 | Parameter Sets: (All) 99 | Aliases: cf 100 | 101 | Required: False 102 | Position: Named 103 | Default value: None 104 | Accept pipeline input: False 105 | Accept wildcard characters: False 106 | ``` 107 | 108 | ### CommonParameters 109 | 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). 110 | 111 | ## INPUTS 112 | 113 | ## OUTPUTS 114 | 115 | ## NOTES 116 | 117 | ## RELATED LINKS 118 | -------------------------------------------------------------------------------- /Docs/Set-HuduCompanyArchive.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduCompanyArchive 9 | 10 | ## SYNOPSIS 11 | Archive/Unarchive a company 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduCompanyArchive [-Id] [-Archive] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to set archive status on a company 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Set-HuduCompanyArchive -Id 1 -Archive $true 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested company 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: False 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -Archive 47 | Boolean for archive status 48 | 49 | ```yaml 50 | Type: Boolean 51 | Parameter Sets: (All) 52 | Aliases: 53 | 54 | Required: True 55 | Position: 2 56 | Default value: False 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -WhatIf 62 | Shows what would happen if the cmdlet runs. 63 | The cmdlet is not run. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: wi 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Confirm 78 | Prompts you for confirmation before running the cmdlet. 79 | 80 | ```yaml 81 | Type: SwitchParameter 82 | Parameter Sets: (All) 83 | Aliases: cf 84 | 85 | Required: False 86 | Position: Named 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Set-HuduFolder.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduFolder 9 | 10 | ## SYNOPSIS 11 | Update a Folder 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduFolder [-Id] [-Name] [[-Icon] ] [[-Description] ] 17 | [[-ParentFolderId] ] [[-CompanyId] ] [-WhatIf] [-Confirm] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | Uses Hudu API to update a folder 22 | 23 | ## EXAMPLES 24 | 25 | ### EXAMPLE 1 26 | ``` 27 | Set-HuduFolder -Id 1 -Name 'New folder name' 28 | ``` 29 | 30 | ## PARAMETERS 31 | 32 | ### -Id 33 | Id of the requested folder 34 | 35 | ```yaml 36 | Type: Int32 37 | Parameter Sets: (All) 38 | Aliases: 39 | 40 | Required: True 41 | Position: 1 42 | Default value: 0 43 | Accept pipeline input: False 44 | Accept wildcard characters: False 45 | ``` 46 | 47 | ### -Name 48 | Name of the folder 49 | 50 | ```yaml 51 | Type: String 52 | Parameter Sets: (All) 53 | Aliases: 54 | 55 | Required: True 56 | Position: 2 57 | Default value: None 58 | Accept pipeline input: False 59 | Accept wildcard characters: False 60 | ``` 61 | 62 | ### -Icon 63 | Folder icon 64 | 65 | ```yaml 66 | Type: String 67 | Parameter Sets: (All) 68 | Aliases: 69 | 70 | Required: False 71 | Position: 3 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Description 78 | Folder description 79 | 80 | ```yaml 81 | Type: String 82 | Parameter Sets: (All) 83 | Aliases: 84 | 85 | Required: False 86 | Position: 4 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### -ParentFolderId 93 | Folder parent id 94 | 95 | ```yaml 96 | Type: Int32 97 | Parameter Sets: (All) 98 | Aliases: parent_folder_id 99 | 100 | Required: False 101 | Position: 5 102 | Default value: None 103 | Accept pipeline input: False 104 | Accept wildcard characters: False 105 | ``` 106 | 107 | ### -CompanyId 108 | Folder company id 109 | 110 | ```yaml 111 | Type: Int32 112 | Parameter Sets: (All) 113 | Aliases: company_id 114 | 115 | Required: False 116 | Position: 6 117 | Default value: None 118 | Accept pipeline input: False 119 | Accept wildcard characters: False 120 | ``` 121 | 122 | ### -WhatIf 123 | Shows what would happen if the cmdlet runs. 124 | The cmdlet is not run. 125 | 126 | ```yaml 127 | Type: SwitchParameter 128 | Parameter Sets: (All) 129 | Aliases: wi 130 | 131 | Required: False 132 | Position: Named 133 | Default value: None 134 | Accept pipeline input: False 135 | Accept wildcard characters: False 136 | ``` 137 | 138 | ### -Confirm 139 | Prompts you for confirmation before running the cmdlet. 140 | 141 | ```yaml 142 | Type: SwitchParameter 143 | Parameter Sets: (All) 144 | Aliases: cf 145 | 146 | Required: False 147 | Position: Named 148 | Default value: None 149 | Accept pipeline input: False 150 | Accept wildcard characters: False 151 | ``` 152 | 153 | ### CommonParameters 154 | 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). 155 | 156 | ## INPUTS 157 | 158 | ## OUTPUTS 159 | 160 | ## NOTES 161 | 162 | ## RELATED LINKS 163 | -------------------------------------------------------------------------------- /Docs/Set-HuduIntegrationMatcher.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduIntegrationMatcher 9 | 10 | ## SYNOPSIS 11 | Update a Matcher 12 | 13 | ## SYNTAX 14 | 15 | ### AcceptSuggestedMatch 16 | ``` 17 | Set-HuduIntegrationMatcher -Id [-AcceptSuggestedMatch] [-PotentialCompanyId ] 18 | [-SyncId ] [-Identifier ] [-WhatIf] [-Confirm] [] 19 | ``` 20 | 21 | ### SetCompanyId 22 | ``` 23 | Set-HuduIntegrationMatcher -Id -CompanyId [-PotentialCompanyId ] [-SyncId ] 24 | [-Identifier ] [-WhatIf] [-Confirm] [] 25 | ``` 26 | 27 | ## DESCRIPTION 28 | Uses Hudu API to set integration matchers 29 | 30 | ## EXAMPLES 31 | 32 | ### EXAMPLE 1 33 | ``` 34 | Set-HuduIntegrationMatcher -Id 1 -AcceptSuggestedMatch 35 | ``` 36 | 37 | ## PARAMETERS 38 | 39 | ### -Id 40 | Id of the requested matcher 41 | 42 | ```yaml 43 | Type: String 44 | Parameter Sets: (All) 45 | Aliases: 46 | 47 | Required: True 48 | Position: Named 49 | Default value: None 50 | Accept pipeline input: True (ByPropertyName) 51 | Accept wildcard characters: False 52 | ``` 53 | 54 | ### -AcceptSuggestedMatch 55 | Set the Sync Id/Identifier to the suggested one 56 | 57 | ```yaml 58 | Type: SwitchParameter 59 | Parameter Sets: AcceptSuggestedMatch 60 | Aliases: 61 | 62 | Required: False 63 | Position: Named 64 | Default value: False 65 | Accept pipeline input: False 66 | Accept wildcard characters: False 67 | ``` 68 | 69 | ### -CompanyId 70 | Requested company id to match 71 | 72 | ```yaml 73 | Type: String 74 | Parameter Sets: SetCompanyId 75 | Aliases: company_id 76 | 77 | Required: True 78 | Position: Named 79 | Default value: None 80 | Accept pipeline input: True (ByPropertyName) 81 | Accept wildcard characters: False 82 | ``` 83 | 84 | ### -PotentialCompanyId 85 | Potential company id to match 86 | 87 | ```yaml 88 | Type: String 89 | Parameter Sets: (All) 90 | Aliases: potential_company_id 91 | 92 | Required: False 93 | Position: Named 94 | Default value: None 95 | Accept pipeline input: True (ByPropertyName) 96 | Accept wildcard characters: False 97 | ``` 98 | 99 | ### -SyncId 100 | Sync id to match 101 | 102 | ```yaml 103 | Type: String 104 | Parameter Sets: (All) 105 | Aliases: sync_id 106 | 107 | Required: False 108 | Position: Named 109 | Default value: None 110 | Accept pipeline input: True (ByPropertyName) 111 | Accept wildcard characters: False 112 | ``` 113 | 114 | ### -Identifier 115 | Identifier to match 116 | 117 | ```yaml 118 | Type: String 119 | Parameter Sets: (All) 120 | Aliases: 121 | 122 | Required: False 123 | Position: Named 124 | Default value: None 125 | Accept pipeline input: True (ByPropertyName) 126 | Accept wildcard characters: False 127 | ``` 128 | 129 | ### -WhatIf 130 | Shows what would happen if the cmdlet runs. 131 | The cmdlet is not run. 132 | 133 | ```yaml 134 | Type: SwitchParameter 135 | Parameter Sets: (All) 136 | Aliases: wi 137 | 138 | Required: False 139 | Position: Named 140 | Default value: None 141 | Accept pipeline input: False 142 | Accept wildcard characters: False 143 | ``` 144 | 145 | ### -Confirm 146 | Prompts you for confirmation before running the cmdlet. 147 | 148 | ```yaml 149 | Type: SwitchParameter 150 | Parameter Sets: (All) 151 | Aliases: cf 152 | 153 | Required: False 154 | Position: Named 155 | Default value: None 156 | Accept pipeline input: False 157 | Accept wildcard characters: False 158 | ``` 159 | 160 | ### CommonParameters 161 | 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). 162 | 163 | ## INPUTS 164 | 165 | ## OUTPUTS 166 | 167 | ## NOTES 168 | 169 | ## RELATED LINKS 170 | -------------------------------------------------------------------------------- /Docs/Set-HuduPasswordArchive.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduPasswordArchive 9 | 10 | ## SYNOPSIS 11 | Archive/Unarchive a Password 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduPasswordArchive [-Id] [-Archive] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | Uses Hudu API to archive or unarchive a password 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Set-HuduPasswordArchive -Archive $true -Id 1 27 | ``` 28 | 29 | ## PARAMETERS 30 | 31 | ### -Id 32 | Id of the requested Password 33 | 34 | ```yaml 35 | Type: Int32 36 | Parameter Sets: (All) 37 | Aliases: 38 | 39 | Required: True 40 | Position: 1 41 | Default value: 0 42 | Accept pipeline input: True (ByPropertyName) 43 | Accept wildcard characters: False 44 | ``` 45 | 46 | ### -Archive 47 | Boolean of archive status 48 | 49 | ```yaml 50 | Type: Boolean 51 | Parameter Sets: (All) 52 | Aliases: 53 | 54 | Required: True 55 | Position: 2 56 | Default value: False 57 | Accept pipeline input: False 58 | Accept wildcard characters: False 59 | ``` 60 | 61 | ### -WhatIf 62 | Shows what would happen if the cmdlet runs. 63 | The cmdlet is not run. 64 | 65 | ```yaml 66 | Type: SwitchParameter 67 | Parameter Sets: (All) 68 | Aliases: wi 69 | 70 | Required: False 71 | Position: Named 72 | Default value: None 73 | Accept pipeline input: False 74 | Accept wildcard characters: False 75 | ``` 76 | 77 | ### -Confirm 78 | Prompts you for confirmation before running the cmdlet. 79 | 80 | ```yaml 81 | Type: SwitchParameter 82 | Parameter Sets: (All) 83 | Aliases: cf 84 | 85 | Required: False 86 | Position: Named 87 | Default value: None 88 | Accept pipeline input: False 89 | Accept wildcard characters: False 90 | ``` 91 | 92 | ### CommonParameters 93 | 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). 94 | 95 | ## INPUTS 96 | 97 | ## OUTPUTS 98 | 99 | ## NOTES 100 | 101 | ## RELATED LINKS 102 | -------------------------------------------------------------------------------- /Docs/Set-HuduWebsite.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: HuduAPI-help.xml 3 | Module Name: HuduAPI 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Set-HuduWebsite 9 | 10 | ## SYNOPSIS 11 | Update a Website 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Set-HuduWebsite [-Id] [-Name] [[-Notes] ] [[-Paused] ] [-CompanyId] 17 | [[-DisableDNS] ] [[-DisableSSL] ] [[-DisableWhois] ] [[-Slug] ] [-WhatIf] 18 | [-Confirm] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | Uses Hudu API to update a website 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Set-HuduWebsite -Id 1 -Paused $true 29 | ``` 30 | 31 | ## PARAMETERS 32 | 33 | ### -Id 34 | Id of requested website 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: True 42 | Position: 1 43 | Default value: 0 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -Name 49 | Website name (e.g. 50 | https://example.com) 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: True 58 | Position: 2 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -Notes 65 | Website Notes 66 | 67 | ```yaml 68 | Type: String 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -Paused 80 | When true, website monitoring is paused. 81 | 82 | ```yaml 83 | Type: String 84 | Parameter Sets: (All) 85 | Aliases: 86 | 87 | Required: False 88 | Position: 4 89 | Default value: None 90 | Accept pipeline input: False 91 | Accept wildcard characters: False 92 | ``` 93 | 94 | ### -CompanyId 95 | Used to associate website with company 96 | 97 | ```yaml 98 | Type: Int32 99 | Parameter Sets: (All) 100 | Aliases: company_id 101 | 102 | Required: True 103 | Position: 5 104 | Default value: 0 105 | Accept pipeline input: False 106 | Accept wildcard characters: False 107 | ``` 108 | 109 | ### -DisableDNS 110 | When true, dns monitoring is paused. 111 | 112 | ```yaml 113 | Type: String 114 | Parameter Sets: (All) 115 | Aliases: disable_dns 116 | 117 | Required: False 118 | Position: 6 119 | Default value: None 120 | Accept pipeline input: False 121 | Accept wildcard characters: False 122 | ``` 123 | 124 | ### -DisableSSL 125 | When true, ssl cert monitoring is paused. 126 | 127 | ```yaml 128 | Type: String 129 | Parameter Sets: (All) 130 | Aliases: disable_ssl 131 | 132 | Required: False 133 | Position: 7 134 | Default value: None 135 | Accept pipeline input: False 136 | Accept wildcard characters: False 137 | ``` 138 | 139 | ### -DisableWhois 140 | When true, whois monitoring is paused. 141 | 142 | ```yaml 143 | Type: String 144 | Parameter Sets: (All) 145 | Aliases: disable_whois 146 | 147 | Required: False 148 | Position: 8 149 | Default value: None 150 | Accept pipeline input: False 151 | Accept wildcard characters: False 152 | ``` 153 | 154 | ### -Slug 155 | Url identifier 156 | 157 | ```yaml 158 | Type: String 159 | Parameter Sets: (All) 160 | Aliases: 161 | 162 | Required: False 163 | Position: 9 164 | Default value: None 165 | Accept pipeline input: False 166 | Accept wildcard characters: False 167 | ``` 168 | 169 | ### -WhatIf 170 | Shows what would happen if the cmdlet runs. 171 | The cmdlet is not run. 172 | 173 | ```yaml 174 | Type: SwitchParameter 175 | Parameter Sets: (All) 176 | Aliases: wi 177 | 178 | Required: False 179 | Position: Named 180 | Default value: None 181 | Accept pipeline input: False 182 | Accept wildcard characters: False 183 | ``` 184 | 185 | ### -Confirm 186 | Prompts you for confirmation before running the cmdlet. 187 | 188 | ```yaml 189 | Type: SwitchParameter 190 | Parameter Sets: (All) 191 | Aliases: cf 192 | 193 | Required: False 194 | Position: Named 195 | Default value: None 196 | Accept pipeline input: False 197 | Accept wildcard characters: False 198 | ``` 199 | 200 | ### CommonParameters 201 | 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). 202 | 203 | ## INPUTS 204 | 205 | ## OUTPUTS 206 | 207 | ## NOTES 208 | 209 | ## RELATED LINKS 210 | -------------------------------------------------------------------------------- /HuduAPI/HuduAPI.psm1: -------------------------------------------------------------------------------- 1 | $Public = @(Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue) + @(Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue) 2 | foreach ($import in @($Public)) { 3 | try { 4 | . $import.FullName 5 | } catch { 6 | Write-Error -Message "Failed to import function $($import.FullName): $_" 7 | } 8 | } 9 | Export-ModuleMember -Function $Public.BaseName -Alias * -------------------------------------------------------------------------------- /HuduAPI/Private/ArgumentCompleters/AssetLayoutCompleter.ps1: -------------------------------------------------------------------------------- 1 | $AssetLayoutCompleter = { 2 | param ( 3 | $CommandName, 4 | $ParamName, 5 | $AssetLayout, 6 | $CommandAst, 7 | $fakeBoundParameters 8 | ) 9 | if (!$script:AssetLayouts) { 10 | Get-HuduAssetLayouts | Out-Null 11 | } 12 | 13 | $AssetLayout = $AssetLayout -replace "'", '' 14 | ($script:AssetLayouts).name | Where-Object { $_ -match "$AssetLayout" } | ForEach-Object { "'$_'" } 15 | } 16 | 17 | Register-ArgumentCompleter -CommandName Get-HuduAssets -ParameterName AssetLayout -ScriptBlock $AssetLayoutCompleter 18 | -------------------------------------------------------------------------------- /HuduAPI/Private/Get-HuduCompanyFolders.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduCompanyFolders { 2 | [CmdletBinding()] 3 | Param ( 4 | [PSCustomObject]$FoldersRaw 5 | ) 6 | 7 | $RootFolders = $FoldersRaw | Where-Object { $null -eq $_.parent_folder_id } 8 | $ReturnObject = [PSCustomObject]@{} 9 | foreach ($folder in $RootFolders) { 10 | $SubFolders = Get-HuduSubFolders -id $folder.id -FoldersRaw $FoldersRaw 11 | foreach ($SubFolder in $SubFolders) { 12 | $Folder | Add-Member -MemberType NoteProperty -Name $(Get-HuduFolderCleanName $($SubFolder.PSObject.Properties.name)) -Value $SubFolder.PSObject.Properties.value 13 | } 14 | $ReturnObject | Add-Member -MemberType NoteProperty -Name $(Get-HuduFolderCleanName $($folder.name)) -Value $folder 15 | } 16 | return $ReturnObject 17 | } -------------------------------------------------------------------------------- /HuduAPI/Private/Get-HuduFolderCleanName.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduFolderCleanName { 2 | [CmdletBinding()] 3 | param( 4 | [string]$Name 5 | ) 6 | 7 | $FieldNames = @('id', 'company_id', 'icon', 'description', 'name', 'parent_folder_id', 'created_at', 'updated_at') 8 | 9 | if ($Name -in $FieldNames) { 10 | Return "fld_$Name" 11 | } else { 12 | Return $Name 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /HuduAPI/Private/Get-HuduSubFolders.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduSubFolders { 2 | [CmdletBinding()] 3 | Param( 4 | [int]$id, 5 | [PSCustomObject]$FoldersRaw 6 | ) 7 | 8 | $SubFolders = $FoldersRaw | Where-Object { $_.parent_folder_id -eq $id } 9 | $ReturnFolders = [System.Collections.ArrayList]@() 10 | foreach ($Folder in $SubFolders) { 11 | $SubSubFolders = Get-HuduSubFolders -id $Folder.id -FoldersRaw $FoldersRaw 12 | foreach ($AddFolder in $SubSubFolders) { 13 | $null = $folder | Add-Member -MemberType NoteProperty -Name $(Get-HuduFolderCleanName $($AddFolder.PSObject.Properties.name)) -Value $AddFolder.PSObject.Properties.value 14 | } 15 | $ReturnObject = [PSCustomObject]@{ 16 | $(Get-HuduFolderCleanName $($Folder.name)) = $Folder 17 | } 18 | $null = $ReturnFolders.add($ReturnObject) 19 | } 20 | 21 | return $ReturnFolders 22 | 23 | } -------------------------------------------------------------------------------- /HuduAPI/Private/Invoke-HuduRequest.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-HuduRequest { 2 | <# 3 | .SYNOPSIS 4 | Main Hudu API function 5 | 6 | .DESCRIPTION 7 | Calls Hudu API with token 8 | 9 | .PARAMETER Method 10 | GET,POST,DELETE,PUT,etc 11 | 12 | .PARAMETER Path 13 | Path to API endpoint 14 | 15 | .PARAMETER Params 16 | Hashtable of parameters 17 | 18 | .PARAMETER Body 19 | JSON encoded body string 20 | 21 | .PARAMETER Form 22 | Multipart form data 23 | 24 | .EXAMPLE 25 | Invoke-HuduRequest -Resource '/api/v1/articles' -Method GET 26 | #> 27 | [CmdletBinding()] 28 | Param( 29 | [Parameter()] 30 | [string]$Method = 'GET', 31 | 32 | [Parameter()] 33 | [ValidateNotNullOrEmpty()] 34 | [string]$Resource, 35 | 36 | [Parameter()] 37 | [hashtable]$Params = @{}, 38 | 39 | [Parameter()] 40 | [string]$Body, 41 | 42 | [Parameter()] 43 | [hashtable]$Form 44 | ) 45 | 46 | $HuduAPIKey = Get-HuduApiKey 47 | $HuduBaseURL = Get-HuduBaseURL 48 | 49 | # Assemble parameters 50 | $ParamCollection = [System.Web.HttpUtility]::ParseQueryString([String]::Empty) 51 | 52 | # Sort parameters 53 | foreach ($Item in ($Params.GetEnumerator() | Sort-Object -CaseSensitive -Property Key)) { 54 | $ParamCollection.Add($Item.Key, $Item.Value) 55 | } 56 | 57 | # Query string 58 | $Request = $ParamCollection.ToString() 59 | 60 | $Headers = @{ 61 | 'x-api-key' = (New-Object PSCredential 'user', $HuduAPIKey).GetNetworkCredential().Password; 62 | } 63 | 64 | if (($Script:Int_HuduCustomHeaders | Measure-Object).count -gt 0){ 65 | 66 | foreach($Entry in $Int_HuduCustomHeaders.GetEnumerator()) { 67 | $Headers[$Entry.Name] = $Entry.Value 68 | } 69 | } 70 | 71 | $ContentType = 'application/json; charset=utf-8' 72 | 73 | $Uri = '{0}{1}' -f $HuduBaseURL, $Resource 74 | # Make API call URI 75 | if ($Request) { 76 | $UriBuilder = [System.UriBuilder]$Uri 77 | $UriBuilder.Query = $Request 78 | $Uri = $UriBuilder.Uri 79 | } 80 | Write-Verbose ( '{0} [{1}]' -f $Method, $Uri ) 81 | 82 | $RestMethod = @{ 83 | Method = $Method 84 | Uri = $Uri 85 | Headers = $Headers 86 | ContentType = $ContentType 87 | } 88 | 89 | if ($Body) { 90 | $RestMethod.Body = $Body 91 | Write-Verbose $Body 92 | } 93 | 94 | if ($Form) { 95 | $RestMethod.Form = $Form 96 | Write-Verbose ( $Form | Out-String ) 97 | } 98 | 99 | try { 100 | $Results = Invoke-RestMethod @RestMethod 101 | } catch { 102 | if ("$_".trim() -eq 'Retry later' -or "$_".trim() -eq 'The remote server returned an error: (429) Too Many Requests.') { 103 | Write-Information 'Hudu API Rate limited. Waiting 30 Seconds then trying again' 104 | Start-Sleep 30 105 | $Results = Invoke-HuduRequest @RestMethod 106 | } else { 107 | Write-Error "'$_'" 108 | } 109 | } 110 | 111 | $Results 112 | } 113 | -------------------------------------------------------------------------------- /HuduAPI/Private/Invoke-HuduRequestPaginated.ps1: -------------------------------------------------------------------------------- 1 | function Invoke-HuduRequestPaginated { 2 | <# 3 | .SYNOPSIS 4 | Paginated requests to Hudu API 5 | 6 | .DESCRIPTION 7 | Wraps Invoke-HuduRequest with page sizes 8 | 9 | .PARAMETER HuduRequest 10 | Request to paginate 11 | 12 | .PARAMETER Property 13 | Property name to return (don't specify to return entire response object) 14 | 15 | .PARAMETER PageSize 16 | Number of results to return per page (default 1000) 17 | 18 | #> 19 | [CmdletBinding()] 20 | Param( 21 | [hashtable]$HuduRequest, 22 | [string]$Property, 23 | [int]$PageSize = 1000 24 | ) 25 | 26 | $i = 1 27 | do { 28 | $HuduRequest.Params.page = $i 29 | $HuduRequest.Params.page_size = $PageSize 30 | $Response = Invoke-HuduRequest @HuduRequest 31 | $i++ 32 | if ($Property) { 33 | $Response.$Property 34 | } 35 | 36 | else { 37 | $Response 38 | } 39 | } while (($Property -and $Response.$Property.count % $PageSize -eq 0 -and $Response.$Property.count -ne 0) -or (!$Property -and $Response.count % $PageSize -eq 0 -and $Response.count -ne 0)) 40 | } 41 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduActivityLogs.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduActivityLogs { 2 | <# 3 | .SYNOPSIS 4 | Get activity logs for account 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve activity logs with filters 8 | 9 | .PARAMETER UserId 10 | Filter logs by user_id 11 | 12 | .PARAMETER UserEmail 13 | Filter logs by email address 14 | 15 | .PARAMETER ResourceId 16 | Filter logs by resource id. Must be coupled with resource_type 17 | 18 | .PARAMETER ResourceType 19 | Filter logs by resource type (Asset, AssetPassword, Company, Article, etc.). Must be coupled with resource_id 20 | 21 | .PARAMETER ActionMessage 22 | Filter logs by action 23 | 24 | .PARAMETER StartDate 25 | Filter logs by start date. Converts string to ISO 8601 format 26 | 27 | .PARAMETER EndDate 28 | Filter logs by end date, should be coupled with start date to limit results 29 | 30 | .EXAMPLE 31 | Get-HuduActivityLogs -StartDate 2023-02-01 32 | 33 | #> 34 | [CmdletBinding()] 35 | Param ( 36 | [Alias('user_id')] 37 | [Int]$UserId = '', 38 | [Alias('user_email')] 39 | [String]$UserEmail = '', 40 | [Alias('resource_id')] 41 | [Int]$ResourceId = '', 42 | [Alias('resource_type')] 43 | [String]$ResourceType = '', 44 | [Alias('action_message')] 45 | [String]$ActionMessage = '', 46 | [Alias('start_date')] 47 | [DateTime]$StartDate, 48 | [Alias('end_date')] 49 | [DateTime]$EndDate 50 | ) 51 | 52 | $Params = @{} 53 | 54 | if ($UserId) { $Params.user_id = $UserId } 55 | if ($UserEmail) { $Params.user_email = $UserEmail } 56 | if ($ResourceId) { $Params.resource_id = $ResourceId } 57 | if ($ResourceType) { $Params.resource_type = $ResourceType } 58 | if ($ActionMessage) { $Params.action_message = $ActionMessage } 59 | if ($StartDate) { 60 | $ISO8601Date = $StartDate.ToString('o'); 61 | $Params.start_date = $ISO8601Date 62 | } 63 | 64 | $HuduRequest = @{ 65 | Method = 'GET' 66 | Resource = '/api/v1/activity_logs' 67 | Params = $Params 68 | } 69 | 70 | $AllActivity = Invoke-HuduRequestPaginated -HuduRequest $HuduRequest 71 | 72 | if ($EndDate) { 73 | $AllActivity = $AllActivity | Where-Object { $([DateTime]::Parse($_.created_at)) -le $EndDate } 74 | } 75 | 76 | return $AllActivity 77 | } 78 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduApiKey.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduApiKey { 2 | <# 3 | .SYNOPSIS 4 | Get Hudu API key 5 | 6 | .DESCRIPTION 7 | Returns Hudu API key in securestring format 8 | 9 | .EXAMPLE 10 | Get-HuduApiKey 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param() 15 | if ($null -eq $Int_HuduAPIKey) { 16 | Write-Error 'No API key has been set. Please use New-HuduAPIKey to set it.' 17 | } else { 18 | $Int_HuduAPIKey 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduAppInfo.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduAppInfo { 2 | <# 3 | .SYNOPSIS 4 | Retrieve information regarding API 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve version number and date 8 | 9 | .EXAMPLE 10 | Get-HuduAppInfo 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param() 15 | 16 | [version]$script:HuduRequiredVersion = '2.21' 17 | 18 | try { 19 | Invoke-HuduRequest -Resource '/api/v1/api_info' 20 | } catch { 21 | [PSCustomObject]@{ 22 | version = '0.0.0.0' 23 | date = '2000-01-01' 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduArticles.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduArticles { 2 | <# 3 | .SYNOPSIS 4 | Get Knowledge Base Articles 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve KB articles by Id or a list 8 | 9 | .PARAMETER Id 10 | Id of the Article 11 | 12 | .PARAMETER CompanyId 13 | Filter by company id 14 | 15 | .PARAMETER Name 16 | Filter by name of article 17 | 18 | .PARAMETER Slug 19 | Filter by slug of article 20 | 21 | .EXAMPLE 22 | Get-HuduArticles -Name 'Article name' 23 | 24 | #> 25 | [CmdletBinding()] 26 | Param ( 27 | [Int]$Id = '', 28 | [Alias('company_id')] 29 | [Int]$CompanyId = '', 30 | [String]$Name = '', 31 | [String]$Slug 32 | ) 33 | 34 | if ($Id) { 35 | Invoke-HuduRequest -Method get -Resource "/api/v1/articles/$Id" 36 | } else { 37 | $Params = @{} 38 | 39 | if ($CompanyId) { $Params.company_id = $CompanyId } 40 | if ($Name) { $Params.name = $Name } 41 | if ($Slug) { $Params.slug = $Slug } 42 | 43 | $HuduRequest = @{ 44 | Method = 'GET' 45 | Resource = '/api/v1/articles' 46 | Params = $Params 47 | } 48 | 49 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property articles 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduAssetLayoutFieldID.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduAssetLayoutFieldID { 2 | <# 3 | .SYNOPSIS 4 | Get Hudu Asset Layout Field ID 5 | 6 | .DESCRIPTION 7 | Retrieves ID for Hudu Asset Layout Fields 8 | 9 | .PARAMETER Name 10 | Name of Field 11 | 12 | .PARAMETER LayoutId 13 | Asset Layout Id 14 | 15 | .EXAMPLE 16 | Get-HuduAssetLayoutFieldID -Name 'Extra Info' -LayoutId 1 17 | 18 | #> 19 | [CmdletBinding()] 20 | Param ( 21 | [Parameter(Mandatory = $true)] 22 | [String]$Name, 23 | [Alias('asset_layout_id')] 24 | [Parameter(Mandatory = $true)] 25 | [Int]$LayoutId 26 | ) 27 | 28 | $Layout = Get-HuduAssetLayouts -LayoutId $LayoutId 29 | 30 | $Fields = [Collections.Generic.List[Object]]($Layout.fields) 31 | $Index = $Fields.FindIndex( { $args[0].label -eq $Name } ) 32 | $Fields[$Index].id 33 | } 34 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduAssetLayouts.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduAssetLayouts { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Asset Layouts 5 | 6 | .DESCRIPTION 7 | Call Hudu API to retrieve asset layouts for server 8 | 9 | .PARAMETER Name 10 | Filter by name of Asset Layout 11 | 12 | .PARAMETER LayoutId 13 | Id of Asset Layout 14 | 15 | .PARAMETER Slug 16 | Filter by url slug 17 | 18 | .EXAMPLE 19 | Get-HuduAssetLayouts -Name 'Contacts' 20 | 21 | #> 22 | [CmdletBinding()] 23 | Param ( 24 | [String]$Name, 25 | [Alias('id', 'layout_id')] 26 | [int]$LayoutId, 27 | [String]$Slug 28 | ) 29 | 30 | $HuduRequest = @{ 31 | Resource = '/api/v1/asset_layouts' 32 | Method = 'GET' 33 | } 34 | 35 | if ($LayoutId) { 36 | $HuduRequest.Resource = '{0}/{1}' -f $HuduRequest.Resource, $LayoutId 37 | $AssetLayout = Invoke-HuduRequest @HuduRequest 38 | return $AssetLayout.asset_layout 39 | } else { 40 | $Params = @{} 41 | if ($Name) { $Params.name = $Name } 42 | if ($Slug) { $Params.slug = $Slug } 43 | $HuduRequest.Params = $Params 44 | 45 | $AssetLayouts = Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'asset_layouts' -PageSize 25 46 | 47 | if (!$Name -and !$Slug) { 48 | $script:AssetLayouts = $AssetLayouts | Sort-Object -Property name 49 | } 50 | $AssetLayouts 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduAssets.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduAssets { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Assets 5 | 6 | .DESCRIPTION 7 | Call Hudu API to retrieve Assets 8 | 9 | .PARAMETER Id 10 | Id of requested asset 11 | 12 | .PARAMETER AssetLayoutId 13 | Id of the requested asset layout 14 | 15 | .PARAMETER AssetLayout 16 | Name of the requested asset layout 17 | 18 | .PARAMETER CompanyId 19 | Id of the requested company 20 | 21 | .PARAMETER Name 22 | Filter by name 23 | 24 | .PARAMETER Archived 25 | Show archived results 26 | 27 | .PARAMETER PrimarySerial 28 | Filter by primary serial 29 | 30 | .PARAMETER Slug 31 | Filter by slug 32 | 33 | .EXAMPLE 34 | Get-HuduAssets -AssetLayout 'Contacts' 35 | 36 | #> 37 | [CmdletBinding()] 38 | Param ( 39 | [ValidateRange(1, [int]::MaxValue)] 40 | [Int]$Id = '', 41 | [Alias('asset_layout_id')] 42 | [ValidateRange(1, [int]::MaxValue)] 43 | [Int]$AssetLayoutId = '', 44 | [string]$AssetLayout, 45 | [Alias('company_id')] 46 | [ValidateRange(1, [int]::MaxValue)] 47 | [Int]$CompanyId = '', 48 | [String]$Name = '', 49 | [switch]$Archived, 50 | [Alias('primary_serial')] 51 | [String]$PrimarySerial = '', 52 | [String]$Slug 53 | ) 54 | 55 | if ($AssetLayout) { 56 | if (!$script:AssetLayouts) { Get-HuduAssetLayouts | Out-Null } 57 | $AssetLayoutId = $script:AssetLayouts | Where-Object { $_.name -eq $AssetLayout } | Select-Object -ExpandProperty id 58 | } 59 | 60 | if ($id -and $CompanyId) { 61 | $HuduRequest = @{ 62 | Resource = "/api/v1/companies/$CompanyId/assets/$Id" 63 | Method = 'GET' 64 | } 65 | Invoke-HuduRequest @HuduRequest 66 | } else { 67 | $Params = @{} 68 | if ($CompanyId) { $Params.company_id = $CompanyId } 69 | if ($AssetLayoutId) { $Params.asset_layout_id = $AssetLayoutId } 70 | if ($Name) { $Params.name = $Name } 71 | if ($Archived.IsPresent) { $params.archived = $Archived.IsPresent } 72 | if ($PrimarySerial) { $Params.primary_serial = $PrimarySerial } 73 | if ($Id) { $Params.id = $Id } 74 | if ($Slug) { $Params.slug = $Slug } 75 | 76 | $HuduRequest = @{ 77 | Resource = '/api/v1/assets' 78 | Method = 'GET' 79 | Params = $Params 80 | } 81 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property assets 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduBaseURL.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduBaseURL { 2 | <# 3 | .SYNOPSIS 4 | Get Hudu Base URL 5 | 6 | .DESCRIPTION 7 | Returns Hudu Base URL 8 | 9 | .EXAMPLE 10 | Get-HuduBaseURL 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param() 15 | if ($null -eq $Int_HuduBaseURL) { 16 | Write-Error 'No Base URL has been set. Please use New-HuduBaseURL to set it.' 17 | } else { 18 | $Int_HuduBaseURL 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduCard.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduCard { 2 | <# 3 | .SYNOPSIS 4 | Get Integration Cards 5 | 6 | .DESCRIPTION 7 | Lookup cards with outside integration details 8 | 9 | .PARAMETER IntegrationSlug 10 | Identifier of outside integration 11 | 12 | .PARAMETER IntegrationId 13 | ID in the integration. Must be present, unless integration_identifier is set 14 | 15 | .PARAMETER IntegrationIdentifier 16 | Identifier in the integration (if integration_id is not set) 17 | 18 | .EXAMPLE 19 | Get-HuduCard -IntegrationSlug cw_manage -IntegrationId 1 20 | 21 | #> 22 | [CmdletBinding()] 23 | Param ( 24 | [Parameter(Mandatory = $true)] 25 | [Alias('integration_slug')] 26 | [String]$IntegrationSlug, 27 | 28 | [Alias('integration_id')] 29 | [String]$IntegrationId, 30 | 31 | [Alias('integration_identifier')] 32 | [String]$IntegrationIdentifier 33 | ) 34 | 35 | $Params = @{ 36 | integration_slug = $IntegrationSlug 37 | } 38 | 39 | if ($IntegrationId) { $Params.integration_id = $IntegrationId } 40 | if ($IntegrationIdentifier) { $Params.integration_identifier = $IntegrationIdentifier } 41 | 42 | if (!$IntegrationId -and !$IntegrationIdentifier) { 43 | throw 'IntegrationId or IntegrationIdentifier required' 44 | } 45 | 46 | $HuduRequest = @{ 47 | Method = 'GET' 48 | Resource = '/api/v1/cards/lookup' 49 | Params = $Params 50 | } 51 | 52 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property integrator_cards 53 | } 54 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduCompanies.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduCompanies { 2 | <# 3 | .SYNOPSIS 4 | Get a list of companies 5 | 6 | .DESCRIPTION 7 | Call Hudu API to retrieve company list 8 | 9 | .PARAMETER Id 10 | Filter companies by id 11 | 12 | .PARAMETER Name 13 | Filter companies by name 14 | 15 | .PARAMETER PhoneNumber 16 | filter companies by phone number 17 | 18 | .PARAMETER Website 19 | Filter companies by website 20 | 21 | .PARAMETER City 22 | Filter companies by city 23 | 24 | .PARAMETER State 25 | Filter companies by state 26 | 27 | .PARAMETER Search 28 | Filter by search query 29 | 30 | .PARAMETER Slug 31 | Filter by url slug 32 | 33 | .PARAMETER IdInIntegration 34 | Filter companies by id/identifier in PSA/RMM/outside integration 35 | 36 | .EXAMPLE 37 | Get-HuduCompanies -Search 'Vendor' 38 | 39 | #> 40 | [CmdletBinding()] 41 | Param ( 42 | [String]$Name = '', 43 | [Alias('phone_number')] 44 | [String]$PhoneNumber = '', 45 | [String]$Website = '', 46 | [String]$City = '', 47 | [String]$State = '', 48 | [Alias('id_in_integration')] 49 | [Int]$IdInIntegration = '', 50 | [Int]$Id = '', 51 | [string]$Search, 52 | [String]$Slug 53 | ) 54 | 55 | if ($Id) { 56 | $Company = (Invoke-HuduRequest -Method get -Resource "/api/v1/companies/$Id").company 57 | return $Company 58 | } else { 59 | $Params = @{} 60 | if ($Name) { $Params.name = $Name } 61 | if ($PhoneNumber) { $Params.phone_number = $PhoneNumber } 62 | if ($Website) { $Params.website = $Website } 63 | if ($City) { $Params.city = $City } 64 | if ($State) { $Params.state = $State } 65 | if ($IdInIntegration) { $Params.id_in_integration = $IdInIntegration } 66 | if ($Search) { $Params.search = $Search } 67 | if ($Slug) { $Params.slug = $Slug } 68 | 69 | $HuduRequest = @{ 70 | Method = 'GET' 71 | Resource = '/api/v1/companies' 72 | Params = $Params 73 | } 74 | 75 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'companies' 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduExpirations.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduExpirations { 2 | <# 3 | .SYNOPSIS 4 | Get expirations for account 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve expirations 8 | 9 | .PARAMETER CompanyId 10 | Filter expirations by company_id 11 | 12 | .PARAMETER ExpirationType 13 | Filter expirations by expiration type (undeclared, domain, ssl_certificate, warranty, asset_field, article_expiration) 14 | 15 | .PARAMETER ResourceId 16 | Filter logs by resource id. Must be coupled with resource_type 17 | 18 | .PARAMETER ResourceType 19 | Filter logs by resource type (Asset, AssetPassword, Company, Article, etc.). Must be coupled with resource_id 20 | 21 | .EXAMPLE 22 | Get-HuduExpirations -ExpirationType domain 23 | 24 | #> 25 | [CmdletBinding()] 26 | Param ( 27 | [Alias('company_id')] 28 | [Int]$CompanyId = '', 29 | 30 | [ValidateSet('undeclared', 'domain', 'ssl_certificate', 'warranty', 'asset_field', 'article_expiration')] 31 | [Alias('expiration_type')] 32 | [String]$ExpirationType = '', 33 | 34 | [Alias('resource_id')] 35 | [Int]$ResourceId = '', 36 | 37 | [Alias('resource_type')] 38 | [String]$ResourceType = '' 39 | ) 40 | 41 | $Params = @{} 42 | 43 | if ($CompanyId) { $Params.company_id = $CompanyId } 44 | if ($ExpirationType) { $Params.expiration_type = $ExpirationType } 45 | if ($ResourceType) { $Params.resource_type = $ResourceType } 46 | if ($ResourceId) { $Params.resource_id = $ResourceId } 47 | 48 | $HuduRequest = @{ 49 | Method = 'GET' 50 | Resource = '/api/v1/expirations' 51 | Params = $Params 52 | } 53 | 54 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest 55 | } 56 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduFolderMap.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduFolderMap { 2 | [CmdletBinding()] 3 | Param ( 4 | [Alias('company_id')] 5 | [Int]$CompanyId = '' 6 | ) 7 | 8 | if ($CompanyId) { 9 | $FoldersRaw = Get-HuduFolders -company_id $CompanyId 10 | $SubFolders = Get-HuduCompanyFolders -FoldersRaw $FoldersRaw 11 | } else { 12 | $FoldersRaw = Get-HuduFolders 13 | $FoldersProcessed = $FoldersRaw | Where-Object { $null -eq $_.company_id } 14 | $SubFolders = Get-HuduCompanyFolders -FoldersRaw $FoldersProcessed 15 | } 16 | 17 | return $SubFolders 18 | } -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduFolders.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduFolders { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Folders 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve folders 8 | 9 | .PARAMETER Id 10 | Id of the folder 11 | 12 | .PARAMETER Name 13 | Filter by name 14 | 15 | .PARAMETER CompanyId 16 | Filter by company_id 17 | 18 | .EXAMPLE 19 | Get-HuduFolders 20 | 21 | #> 22 | [CmdletBinding()] 23 | Param ( 24 | [Int]$Id = '', 25 | [String]$Name = '', 26 | [Alias('company_id')] 27 | [Int]$CompanyId = '' 28 | ) 29 | 30 | if ($id) { 31 | $Folder = Invoke-HuduRequest -Method get -Resource "/api/v1/folders/$id" 32 | return $Folder.Folder 33 | } else { 34 | $Params = @{} 35 | 36 | if ($CompanyId) { $Params.company_id = $CompanyId } 37 | if ($Name) { $Params.name = $Name } 38 | 39 | $HuduRequest = @{ 40 | Method = 'GET' 41 | Resource = '/api/v1/folders' 42 | Params = $Params 43 | } 44 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property folders 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduIntegrationMatchers.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduIntegrationMatchers { 2 | <# 3 | .SYNOPSIS 4 | List matchers for an integration 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to get list of integration matching 8 | 9 | .PARAMETER IntegrationId 10 | ID of the integration. Can be found in the URL when editing an integration 11 | 12 | .PARAMETER Matched 13 | Filter on whether the company already been matched 14 | 15 | .PARAMETER SyncId 16 | Filter by ID of the record in the integration. This is used if the id that the integration uses is an integer. 17 | 18 | .PARAMETER Identifier 19 | Filter by Identifier in the integration (if sync_id is not set). This is used if the id that the integration uses is a string. 20 | 21 | .PARAMETER CompanyId 22 | Filter on company id 23 | 24 | .EXAMPLE 25 | Get-HuduIntegrationMatchers -IntegrationId 1 26 | 27 | #> 28 | [CmdletBinding()] 29 | Param ( 30 | [Parameter(Mandatory = $true)] 31 | [int]$IntegrationId, 32 | 33 | [switch]$Matched, 34 | 35 | [int]$SyncId = '', 36 | 37 | [string]$Identifier = '', 38 | 39 | [int]$CompanyId 40 | ) 41 | 42 | $Params = @{ 43 | integration_id = $IntegrationId 44 | } 45 | 46 | if ($Matched.IsPresent) { $Params.matched = 'true' } 47 | if ($CompanyId) { $Params.company_id = $CompanyId } 48 | if ($Identifier) { $Params.identifier = $Identifier } 49 | if ($SyncId) { $Params.sync_id = $SyncId } 50 | 51 | $HuduRequest = @{ 52 | Method = 'GET' 53 | Resource = '/api/v1/matchers' 54 | Params = $Params 55 | } 56 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'matchers' 57 | } 58 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduMagicDashes.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduMagicDashes { 2 | <# 3 | .SYNOPSIS 4 | Get all Magic Dash Items 5 | 6 | .DESCRIPTION 7 | Call Hudu API to retrieve Magic Dashes 8 | 9 | .PARAMETER CompanyId 10 | Filter by company id 11 | 12 | .PARAMETER Title 13 | Filter by title 14 | 15 | .EXAMPLE 16 | Get-HuduMagicDashes -Title 'Microsoft 365 - ...' 17 | 18 | #> 19 | Param ( 20 | [Alias('company_id')] 21 | [Int]$CompanyId, 22 | [String]$Title 23 | ) 24 | 25 | $Params = @{} 26 | 27 | if ($CompanyId) { $Params.company_id = $CompanyId } 28 | if ($Title) { $Params.title = $Title } 29 | 30 | $HuduRequest = @{ 31 | Method = 'GET' 32 | Resource = '/api/v1/magic_dash' 33 | Params = $Params 34 | } 35 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest 36 | } 37 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduObjectByUrl.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduObjectByUrl { 2 | <# 3 | .SYNOPSIS 4 | Get Hudu object from URL 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve object based on URL string 8 | 9 | .PARAMETER Url 10 | Url to retrieve object from 11 | 12 | .EXAMPLE 13 | Get-HuduObject -Url https://your-hudu-server/a/some-asset-1z8z7a 14 | 15 | #> 16 | [CmdletBinding()] 17 | Param ( 18 | [uri]$Url 19 | ) 20 | 21 | if ((Get-HuduBaseURL) -match $Url.Authority) { 22 | $null, $Type, $Slug = $Url.PathAndQuery -split '/' 23 | 24 | $SlugSplat = @{ 25 | Slug = $Slug 26 | } 27 | 28 | switch ($Type) { 29 | 'a' { 30 | # Asset 31 | Get-HuduAssets @SlugSplat 32 | } 33 | 'admin' { 34 | # Admin path 35 | $null, $null, $Type, $Slug = $Url.PathAndQuery -split '/' 36 | $SlugSplat = @{ 37 | Slug = $Slug 38 | } 39 | switch ($Type) { 40 | 'asset_layouts' { 41 | # Asset layouts 42 | Get-HuduAssetLayouts @SlugSplat 43 | } 44 | } 45 | } 46 | 'c' { 47 | # Company 48 | Get-HuduCompanies @SlugSplat 49 | } 50 | 'kba' { 51 | # KB article 52 | Get-HuduArticles @SlugSplat 53 | } 54 | 'passwords' { 55 | # Passwords 56 | Get-HuduPasswords @SlugSplat 57 | } 58 | 'websites' { 59 | # Website 60 | Get-HuduWebsites @SlugSplat 61 | } 62 | default { 63 | Write-Error "Unsupported object type $Type" 64 | } 65 | } 66 | } else { 67 | Write-Error 'Provided URL does not match Hudu Base URL' 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduPasswordFolders.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduPasswordFolders { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Password Folders 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve folders 8 | 9 | .PARAMETER Id 10 | Id of the folder 11 | 12 | .PARAMETER Name 13 | Filter by name 14 | 15 | .PARAMETER CompanyId 16 | Filter by company_id 17 | 18 | .EXAMPLE 19 | Get-HuduFolders 20 | 21 | #> 22 | [CmdletBinding()] 23 | Param ( 24 | [Int]$Id = '', 25 | [String]$Name = '', 26 | [String]$Search = '', 27 | [Alias('company_id')] 28 | [Int]$CompanyId = '', 29 | [Int]$page = '', 30 | [Int]$page_size = '' 31 | ) 32 | 33 | if ($id) { 34 | $Folder = Invoke-HuduRequest -Method get -Resource "/api/v1/password_folders/$id" 35 | return $Folder.password_folder 36 | } else { 37 | $Params = @{} 38 | 39 | if ($CompanyId) { $Params.company_id = $CompanyId } 40 | if ($Name) { $Params.name = $Name } 41 | 42 | $HuduRequest = @{ 43 | Method = 'GET' 44 | Resource = '/api/v1/password_folders' 45 | Params = $Params 46 | } 47 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property password_folders 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduPasswords.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduPasswords { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Passwords 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to list password assets 8 | 9 | .PARAMETER Id 10 | Id of the password 11 | 12 | .PARAMETER CompanyId 13 | Filter by company id 14 | 15 | .PARAMETER Name 16 | Filter by password name 17 | 18 | .PARAMETER Slug 19 | Filter by url slug 20 | 21 | .PARAMETER Search 22 | Filter by search query 23 | 24 | .EXAMPLE 25 | Get-HuduPasswords -CompanyId 1 26 | 27 | #> 28 | [CmdletBinding()] 29 | Param ( 30 | [Int]$Id, 31 | 32 | [Alias('company_id')] 33 | [Int]$CompanyId, 34 | 35 | [String]$Name, 36 | 37 | [String]$Slug, 38 | 39 | [string]$Search 40 | ) 41 | 42 | if ($Id) { 43 | $Password = Invoke-HuduRequest -Method get -Resource "/api/v1/asset_passwords/$id" 44 | return $Password 45 | } else { 46 | $Params = @{} 47 | if ($CompanyId) { $Params.company_id = $CompanyId } 48 | if ($Name) { $Params.name = $Name } 49 | if ($Slug) { $Params.slug = $Slug } 50 | if ($Search) { $Params.search = $Search } 51 | } 52 | 53 | $HuduRequest = @{ 54 | Method = 'GET' 55 | Resource = '/api/v1/asset_passwords' 56 | Params = $Params 57 | } 58 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'asset_passwords' 59 | } 60 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduProcesses.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduProcesses { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Procedures (Processes) 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve list of procedures 8 | 9 | .PARAMETER Id 10 | Id of the Procedure 11 | 12 | .PARAMETER CompanyId 13 | Filter by company id 14 | 15 | .PARAMETER Name 16 | Fitler by name of article 17 | 18 | .PARAMETER Slug 19 | Filter by url slug 20 | 21 | .EXAMPLE 22 | Get-HuduProcedures -Name 'Procedure 1' 23 | 24 | #> 25 | [CmdletBinding()] 26 | Param ( 27 | [Int]$Id = '', 28 | [Alias('company_id')] 29 | [Int]$CompanyId = '', 30 | [String]$Name = '', 31 | [String]$Slug 32 | ) 33 | 34 | if ($Id) { 35 | Invoke-HuduRequest -Method get -Resource "/api/v1/procedures/$id" 36 | } else { 37 | $Params = @{} 38 | 39 | if ($CompanyId) { $Params.company_id = $CompanyId } 40 | if ($Name) { $Params.name = $Name } 41 | if ($Slug) { $Params.slug = $Slug } 42 | 43 | 44 | $HuduRequest = @{ 45 | Method = 'GET' 46 | Resource = '/api/v1/procedures' 47 | Params = $Params 48 | } 49 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'procedures' 50 | } 51 | } -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduPublicPhotos.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduPublicPhotos { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Public_Photos 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve public photos 8 | 9 | .EXAMPLE 10 | Get-HuduPublicPhotos 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param() 15 | 16 | $HuduRequest = @{ 17 | Method = 'GET' 18 | Resource = '/api/v1/public_photos' 19 | Params = @{} 20 | } 21 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'public_photos' 22 | } 23 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduRelations.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduRelations { 2 | <# 3 | .SYNOPSIS 4 | Get a list of all relations 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve object relationsihps 8 | 9 | .EXAMPLE 10 | Get-HuduRelations -CompanyId 1 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param() 15 | 16 | $HuduRequest = @{ 17 | Method = 'GET' 18 | Resource = '/api/v1/relations' 19 | Params = @{} 20 | } 21 | 22 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property 'relations' 23 | } 24 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduUploads.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduUploads { 2 | <# 3 | .SYNOPSIS 4 | Get a list of uploads 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to retrieve uploads 8 | 9 | .EXAMPLE 10 | Get-HuduUploads 11 | 12 | #> 13 | [CmdletBinding()] 14 | Param( 15 | [Int]$Id 16 | ) 17 | 18 | if ($Id) { 19 | $Upload = Invoke-HuduRequest -Method Get -Resource "/api/v1/uploads/$Id" 20 | } else { 21 | $Upload = Invoke-HuduRequest -Method Get -Resource "/api/v1/uploads" 22 | } 23 | return $Upload 24 | } 25 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduUsers.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduUsers { 2 | <# 3 | .SYNOPSIS 4 | Get a list of Users 5 | 6 | .DESCRIPTION 7 | Call Hudu API to retrieve Users 8 | 9 | .PARAMETER Id 10 | Id of requested users 11 | 12 | .PARAMETER Users 13 | Name of the requested user 14 | 15 | .PARAMETER CompanyId 16 | Id of the requested company 17 | 18 | .PARAMETER Name 19 | Filter by name 20 | 21 | .PARAMETER Archived 22 | Show archived results 23 | 24 | .PARAMETER Slug 25 | Filter by slug of user 26 | 27 | .EXAMPLE 28 | Get-HuduUsers -Name 'Jim' 29 | #> 30 | 31 | [CmdletBinding()] 32 | Param ( 33 | [ValidateRange(1, [int]::MaxValue)] 34 | [Int]$Id = '', 35 | [string]$Email = '', 36 | [string]$First_name = '', 37 | [string]$Last_name = '', 38 | [ValidateRange(1, [int]::MaxValue)] 39 | [Int]$Portal_member_company_id = '', 40 | [String]$Securitylevel = '', 41 | [string]$Slug = '' 42 | ) 43 | 44 | if ($Id) { 45 | Invoke-HuduRequest -Method get -Resource "/api/v1/users/$Id" 46 | } else { 47 | $Params = @{} 48 | 49 | if ($First_name) { $Params.first_name = $First_name} 50 | if ($Last_name) { $Params.last_name = $Last_name} 51 | if ($Email) { $Params.email = $Email} 52 | 53 | $HuduRequest = @{ 54 | Method = 'GET' 55 | Resource = '/api/v1/users' 56 | Params = $Params 57 | } 58 | 59 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property Users 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /HuduAPI/Public/Get-HuduWebsites.ps1: -------------------------------------------------------------------------------- 1 | function Get-HuduWebsites { 2 | <# 3 | .SYNOPSIS 4 | Get a list of all websites 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to get websites 8 | 9 | .PARAMETER Name 10 | Filter websites by name 11 | 12 | .PARAMETER Id 13 | ID of website 14 | 15 | .PARAMETER Slug 16 | Filter by url slug 17 | 18 | .PARAMETER Search 19 | Fitler by search query 20 | 21 | .EXAMPLE 22 | Get-HuduWebsites -Search 'domain.com' 23 | 24 | #> 25 | [CmdletBinding()] 26 | Param ( 27 | [String]$Name, 28 | [Alias('website_id')] 29 | [Int]$WebsiteId, 30 | [String]$Slug, 31 | [string]$Search 32 | ) 33 | 34 | if ($WebsiteId) { 35 | Invoke-HuduRequest -Method get -Resource "/api/v1/websites/$($WebsiteId)" 36 | } else { 37 | $Params = @{} 38 | if ($Name) { $Params.name = $Name } 39 | if ($Slug) { $Params.slug = $Slug } 40 | if ($Search) { $Params.search = $Search } 41 | 42 | $HuduRequest = @{ 43 | Method = 'GET' 44 | Resource = '/api/v1/websites' 45 | Params = $Params 46 | } 47 | Invoke-HuduRequestPaginated -HuduRequest $HuduRequest 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /HuduAPI/Public/Initialize-HuduFolder.ps1: -------------------------------------------------------------------------------- 1 | function Initialize-HuduFolder { 2 | [CmdletBinding()] 3 | param( 4 | [String[]]$FolderPath, 5 | [Alias('company_id')] 6 | [int]$CompanyId 7 | ) 8 | 9 | if ($CompanyId) { 10 | $FolderMap = Get-HuduFolderMap -company_id $CompanyId 11 | } else { 12 | $FolderMap = Get-HuduFolderMap 13 | } 14 | 15 | $CurrentFolder = $Foldermap 16 | foreach ($Folder in $FolderPath) { 17 | if ($CurrentFolder.$(Get-HuduFolderCleanName $Folder)) { 18 | $CurrentFolder = $CurrentFolder.$(Get-HuduFolderCleanName $Folder) 19 | } else { 20 | $CurrentFolder = (New-HuduFolder -Name $Folder -company_id $CompanyID -parent_folder_id $CurrentFolder.id).folder 21 | } 22 | } 23 | 24 | return $CurrentFolder 25 | } 26 | -------------------------------------------------------------------------------- /HuduAPI/Public/Move-HuduAssetsToNewLayout.ps1: -------------------------------------------------------------------------------- 1 | function Move-HuduAssetsToNewLayout { 2 | <# 3 | .SYNOPSIS 4 | Moves an Asset between two Asset Layouts 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to move an Asset from one Asset Layout to another 8 | 9 | .PARAMETER CompanyId 10 | Company id of the Asset 11 | 12 | .PARAMETER AssetLayoutId 13 | New Asset layout id where the asset will be moved to 14 | 15 | .PARAMETER AssetId 16 | Id of the Asset to move 17 | 18 | .EXAMPLE 19 | Move-HuduAssetsToNewLayout -AssetId 5 -CompanyId 1 -AssetLayoutId 5 20 | 21 | .NOTES 22 | General notes 23 | #> 24 | [CmdletBinding(SupportsShouldProcess)] 25 | Param ( 26 | [String]$Name, 27 | 28 | [Alias('company_id')] 29 | [Int]$CompanyId, 30 | 31 | [Alias('asset_layout_id')] 32 | [Int]$AssetLayoutId, 33 | 34 | [Alias('asset_id','assetid')] 35 | [Parameter(Mandatory = $true)] 36 | [ValidateRange(1, [int]::MaxValue)] 37 | [Int]$Id 38 | ) 39 | 40 | $Object = Get-HuduAssets -id $Id | Select-Object name,asset_layout_id,company_id,slug,primary_serial,primary_model,primary_mail,id,primary_manufacturer,@{n='custom_fields';e={$_.fields | ForEach-Object {[pscustomobject]@{$_.label.replace(' ','_').tolower()= $_.value}}}} 41 | if ($Object) { 42 | $Asset = [pscustomobject]@{asset_layout_id = $AssetLayoutId} 43 | 44 | 45 | $JSON = $Asset | ConvertTo-Json -Depth 10 46 | 47 | if ($PSCmdlet.ShouldProcess("ID: $($Asset.id) Name: $($Asset.Name)", "Move Asset from Layout $($Object.asset_layout_id) to $($AssetLayoutId)")) { 48 | Invoke-HuduRequest -Method put -Resource "/api/v1/companies/$CompanyId/assets/$Id/move_layout" -Body $JSON 49 | } 50 | } else { 51 | throw "A valid asset could not be found to update, please double check the ID and try again" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /HuduAPI/Public/Move-HuduAssetsToNewLayoutDeprecated.ps1: -------------------------------------------------------------------------------- 1 | function Move-HuduAssetsToNewLayout { 2 | <# 3 | .SYNOPSIS 4 | Helper function that uses the Set-HuduAsset function to move an asset between asset layouts. This will leave behind orphan data in the database. 5 | Review the article https://portal.risingtidegroup.net/kb?id=29 for more details. 6 | 7 | .DESCRIPTION 8 | Calls the Hudu API to update an asset by switching its asset_layout_id property to a different asset layout. 9 | This function migrates the asset to the specified new layout while maintaining its fields. Note that this 10 | operation may leave behind orphaned data in the Hudu database, so use it with caution. 11 | 12 | .PARAMETER AssetsToMove 13 | An array of assets to be moved to a new asset layout. Each asset must contain both 'id' and 'fields' properties. 14 | 15 | .PARAMETER NewAssetLayoutID 16 | The ID of the new asset layout to which the assets will be moved. 17 | 18 | .EXAMPLE 19 | $AssetLayout = Get-HuduAssetLayouts -Name "Servers" 20 | $AssetsToUpdate = Get-HuduAssets -AssetLayoutId 9 21 | Move-HuduAssetsToNewLayout -AssetsToMove $AssetsToUpdate -NewAssetLayoutID $AssetLayout.id 22 | 23 | This example retrieves the asset layout with the name "Servers" and the assets with the layout ID 9, then moves those assets to the new layout. 24 | 25 | .NOTES 26 | Ensure that the new asset layout ID is valid and that the assets to be moved contain the required properties. 27 | Using this function may result in orphaned data in your Hudu database. Review the provided article for more details. 28 | #> 29 | [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] 30 | param( 31 | [Parameter(Mandatory = $true)] 32 | [ValidateNotNullOrEmpty()] 33 | [ValidateScript({ 34 | if ($BadAssets = ($_ | where {(-not $_.id)})) { 35 | $BadAssets 36 | throw "Assets must be an object with an ID" 37 | } 38 | return $true 39 | })] 40 | [array] 41 | $AssetsToMove, 42 | 43 | [Parameter(Mandatory = $true)] 44 | [int] 45 | $NewAssetLayoutID 46 | ) 47 | 48 | Write-Warning "Performing this function will leave behind orphaned data in your Hudu database. Please review https://portal.risingtidegroup.net/kb?id=29" 49 | Read-Host "Press Enter to continue or (CTRL+C) to cancel..." 50 | 51 | $assets = foreach ($AssetToMove in $AssetsToMove) { 52 | if (-not ($AssetToMove.PSObject.Properties.Match('id')) -or -not ($AssetToMove.PSObject.Properties.Match('fields'))) { 53 | Write-Error "Asset does not contain both 'id' and 'fields' properties. Skipping this asset." 54 | continue 55 | } 56 | 57 | if (-not $AssetToMove.fields) { 58 | Write-Warning "Asset ID: $($AssetToMove.id) has no fields. Proceeding with moving the asset." 59 | } 60 | 61 | $assetId = $AssetToMove.id 62 | 63 | if ($PSCmdlet.ShouldProcess("Asset ID: $assetId", "Move to new layout with ID $NewAssetLayoutID")) { 64 | try { 65 | Write-Verbose "Processing Asset ID: $assetId" 66 | 67 | $fields = New-Object -TypeName psobject 68 | foreach ($field in $AssetToMove.fields) { 69 | $fieldName = $field.label.replace(' ', '_').tolower() 70 | $fields | Add-Member -MemberType NoteProperty -Name $fieldName -Value $field.value -Force 71 | } 72 | 73 | (Set-HuduAsset -Id $assetId -AssetLayoutId $NewAssetLayoutID -Fields $fields).asset 74 | 75 | Write-Verbose "Successfully moved Asset ID: $assetId" 76 | } 77 | catch { 78 | Write-Error "Failed to move Asset ID: $assetId. Error: $_" 79 | } 80 | finally { 81 | Remove-Variable -Name fields -ErrorAction SilentlyContinue 82 | } 83 | } 84 | } 85 | return $assets 86 | } 87 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduAPIKey.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduAPIKey { 2 | <# 3 | .SYNOPSIS 4 | Set Hudu API Key 5 | 6 | .DESCRIPTION 7 | API keys are required to interact with Hudu 8 | 9 | .PARAMETER ApiKey 10 | The API key 11 | 12 | .EXAMPLE 13 | New-HuduAPIKey -ApiKey abdc1234 14 | 15 | #> 16 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope = 'Function')] 17 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function')] 18 | [CmdletBinding()] 19 | Param ( 20 | [Parameter(Mandatory = $false, ValueFromPipeline = $true)] 21 | [String]$ApiKey 22 | ) 23 | 24 | process { 25 | if ($ApiKey) { 26 | $SecApiKey = ConvertTo-SecureString $ApiKey -AsPlainText -Force 27 | } else { 28 | $SecApiKey = Read-Host -Prompt 'Please enter your Hudu API key, you can obtain it from https://your-hudu-domain/admin/api_keys:' -AsSecureString 29 | } 30 | Set-Variable -Name 'Int_HuduAPIKey' -Value $SecApiKey -Visibility Private -Scope script -Force 31 | 32 | if ($script:Int_HuduBaseURL) { 33 | [version]$version = (Get-HuduAppInfo).version 34 | if ($version -lt $script:HuduRequiredVersion) { 35 | Write-Warning "A connection error occured or Hudu version is below $script:HuduRequiredVersion" 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduArticle.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduArticle { 2 | <# 3 | .SYNOPSIS 4 | Create a Knowledge Base Article 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create KB articles 8 | 9 | .PARAMETER Name 10 | Name of article 11 | 12 | .PARAMETER Content 13 | Article HTML contents 14 | 15 | .PARAMETER EnableSharing 16 | Create public URL for users to view without being authenticated 17 | 18 | .PARAMETER FolderId 19 | Associate article with folder id 20 | 21 | .PARAMETER CompanyId 22 | Associate article with company id 23 | 24 | .PARAMETER Slug 25 | Manually define slug for Article 26 | 27 | .EXAMPLE 28 | New-HuduArticle -Name "Test" -CompanyId 1 -Content '

Testing

' -EnableSharing -Slug 'this-is-a-test' 29 | 30 | #> 31 | [CmdletBinding(SupportsShouldProcess)] 32 | Param ( 33 | [Parameter(Mandatory = $true)] 34 | [String]$Name, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [String]$Content, 38 | 39 | [switch]$EnableSharing, 40 | 41 | [Alias('folder_id')] 42 | [Int]$FolderId = '', 43 | 44 | [Alias('company_id')] 45 | [Int]$CompanyId = '', 46 | 47 | [string]$Slug 48 | ) 49 | 50 | $Article = [ordered]@{article = [ordered]@{} } 51 | 52 | $Article.article.add('name', $Name) 53 | $Article.article.add('content', $Content) 54 | 55 | if ($FolderId) { 56 | $Article.article.add('folder_id', $FolderId) 57 | } 58 | 59 | if ($CompanyId) { 60 | $Article.article.add('company_id', $CompanyId) 61 | } 62 | 63 | if ($EnableSharing.IsPresent) { 64 | $Article.article.add('enable_sharing', 'true') 65 | } 66 | 67 | if ($Slug) { 68 | $Article.article.add('slug', $Slug) 69 | } 70 | 71 | $JSON = $Article | ConvertTo-Json -Depth 10 72 | 73 | if ($PSCmdlet.ShouldProcess($Name)) { 74 | Invoke-HuduRequest -Method post -Resource '/api/v1/articles' -Body $JSON 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduAsset.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduAsset { 2 | <# 3 | .SYNOPSIS 4 | Create an Asset 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create assets using custom layouts 8 | 9 | .PARAMETER Name 10 | Name of the Asset 11 | 12 | .PARAMETER CompanyId 13 | Company id for asset 14 | 15 | .PARAMETER AssetLayoutId 16 | Asset layout id 17 | 18 | .PARAMETER Fields 19 | Array of custom fields and values 20 | 21 | .PARAMETER PrimarySerial 22 | Asset primary serial number 23 | 24 | .PARAMETER PrimaryMail 25 | Asset primary mail 26 | 27 | .PARAMETER PrimaryModel 28 | Asset primary model 29 | 30 | .PARAMETER PrimaryManufacturer 31 | Asset primary manufacturer 32 | 33 | .PARAMETER Slug 34 | Url identifier 35 | 36 | .EXAMPLE 37 | New-HuduAsset -Name 'Some asset' -CompanyId 1 -Fields @(@{'field_name'='Field Value'}) 38 | 39 | #> 40 | [CmdletBinding(SupportsShouldProcess)] 41 | Param ( 42 | [Parameter(Mandatory = $true)] 43 | [String]$Name, 44 | 45 | [Alias('company_id')] 46 | [Parameter(Mandatory = $true)] 47 | [Int]$CompanyId, 48 | 49 | [Alias('asset_layout_id')] 50 | [Parameter(Mandatory = $true)] 51 | [Int]$AssetLayoutId, 52 | 53 | [Array]$Fields, 54 | 55 | [Alias('primary_serial')] 56 | [string]$PrimarySerial, 57 | 58 | [Alias('primary_mail')] 59 | [string]$PrimaryMail, 60 | 61 | [Alias('primary_model')] 62 | [string]$PrimaryModel, 63 | 64 | [Alias('primary_manufacturer')] 65 | [string]$PrimaryManufacturer 66 | ) 67 | 68 | $Asset = [ordered]@{asset = [ordered]@{} } 69 | 70 | $Asset.asset.add('name', $Name) 71 | $Asset.asset.add('asset_layout_id', $AssetLayoutId) 72 | 73 | 74 | if ($PrimarySerial) { 75 | $Asset.asset.add('primary_serial', $PrimarySerial) 76 | } 77 | 78 | if ($PrimaryMail) { 79 | $Asset.asset.add('primary_mail', $PrimaryMail) 80 | } 81 | 82 | if ($PrimaryModel) { 83 | $Asset.asset.add('primary_model', $PrimaryModel) 84 | } 85 | 86 | if ($PrimaryManufacturer) { 87 | $Asset.asset.add('primary_manufacturer', $PrimaryManufacturer) 88 | } 89 | 90 | if ($Fields) { 91 | $Asset.asset.add('custom_fields', $Fields) 92 | } 93 | 94 | if ($Slug) { 95 | $Asset.asset.add('slug', $Slug) 96 | } 97 | 98 | $JSON = $Asset | ConvertTo-Json -Depth 10 99 | 100 | if ($PSCmdlet.ShouldProcess($Name)) { 101 | Invoke-HuduRequest -Method post -Resource "/api/v1/companies/$CompanyId/assets" -Body $JSON 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduBaseURL.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduBaseURL { 2 | <# 3 | .SYNOPSIS 4 | Set Hudu Base URL 5 | 6 | .DESCRIPTION 7 | In order to access the Hudu API the Base URL must be set 8 | 9 | .PARAMETER BaseURL 10 | Url with no trailing slash e.g. https://demo.huducloud.com 11 | 12 | .EXAMPLE 13 | New-HuduBaseURL -BaseURL https://demo.huducloud.com 14 | 15 | .NOTES 16 | General notes 17 | #> 18 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function')] 19 | [CmdletBinding()] 20 | Param ( 21 | [Parameter(Mandatory = $false, 22 | ValueFromPipeline = $true)] 23 | [String] 24 | $BaseURL 25 | ) 26 | process { 27 | if (!$BaseURL) { 28 | $BaseURL = Read-Host -Prompt 'Please enter your Hudu Base URL with no trailing /, for example https://demo.huducloud.com :' 29 | } 30 | 31 | $Protocol = $BaseURL[0..7] -join '' 32 | if ($Protocol -ne 'https://') { 33 | if ($Protocol -like 'http://*') { 34 | Write-Warning "Non HTTPS Base URL was set, rewriting URL to be secure transport only. If connection fails please make sure hostname is correct and HTTPS is enabld." 35 | $BaseURL = $BaseURL.Replace('http://','https://') 36 | } 37 | else { 38 | Write-Warning "No protocol was specified, adding https:// to the beginning of the specified hostname" 39 | $BaseURL = "https://$BaseURL" 40 | } 41 | } 42 | 43 | Set-Variable -Name 'Int_HuduBaseURL' -Value $BaseURL -Visibility Private -Scope script -Force 44 | 45 | if ($script:Int_HuduAPIKey) { 46 | [version]$Version = (Get-HuduAppInfo).version 47 | if ($Version -lt $script:HuduRequiredVersion) { 48 | Write-Warning "A connection error occured or Hudu version is below $script:HuduRequiredVersion" 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduCompany.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduCompany { 2 | <# 3 | .SYNOPSIS 4 | Create a company 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create a new company 8 | 9 | .PARAMETER Name 10 | Company name 11 | 12 | .PARAMETER Nickname 13 | Company nickname 14 | 15 | .PARAMETER CompanyType 16 | Company type 17 | 18 | .PARAMETER AddressLine1 19 | Address line 1 20 | 21 | .PARAMETER AddressLine2 22 | Address line 2 23 | 24 | .PARAMETER City 25 | City 26 | 27 | .PARAMETER State 28 | State 29 | 30 | .PARAMETER Zip 31 | Zip 32 | 33 | .PARAMETER CountryName 34 | Country 35 | 36 | .PARAMETER PhoneNumber 37 | Phone number 38 | 39 | .PARAMETER FaxNumber 40 | Fax number 41 | 42 | .PARAMETER Website 43 | Website 44 | 45 | .PARAMETER IdNumber 46 | Company id number 47 | 48 | .PARAMETER ParentCompanyId 49 | Parent company id number 50 | 51 | .PARAMETER Notes 52 | Parameter description 53 | 54 | .PARAMETER Slug 55 | Url identifier 56 | 57 | .EXAMPLE 58 | New-HuduCompany -Name 'Company name' 59 | 60 | #> 61 | [CmdletBinding(SupportsShouldProcess)] 62 | Param ( 63 | [Parameter(Mandatory = $true)] 64 | [String]$Name, 65 | 66 | [String]$Nickname = '', 67 | 68 | [Alias('company_type')] 69 | [String]$CompanyType = '', 70 | 71 | [Alias('address_line_1')] 72 | [String]$AddressLine1 = '', 73 | 74 | [Alias('address_line_2')] 75 | [String]$AddressLine2 = '', 76 | 77 | [String]$City = '', 78 | 79 | [String]$State = '', 80 | 81 | [Alias('PostalCode', 'PostCode')] 82 | [String]$Zip = '', 83 | 84 | [Alias('country_name')] 85 | [String]$CountryName = '', 86 | 87 | [Alias('phone_number')] 88 | [String]$PhoneNumber = '', 89 | 90 | [Alias('fax_number')] 91 | [String]$FaxNumber = '', 92 | 93 | [String]$Website = '', 94 | 95 | [Alias('id_number')] 96 | [String]$IdNumber = '', 97 | 98 | [Alias('parent_company_id')] 99 | [int]$ParentCompanyId, 100 | 101 | [String]$Notes = '', 102 | 103 | [string]$Slug 104 | ) 105 | 106 | 107 | $Company = [ordered]@{company = [ordered]@{} } 108 | 109 | $Company.company.add('name', $Name) 110 | if (-not ([string]::IsNullOrEmpty($Nickname))) { $Company.company.add('nickname', $Nickname) } 111 | if (-not ([string]::IsNullOrEmpty($Nickname))) { $Company.company.add('company_type', $CompanyType) } 112 | if (-not ([string]::IsNullOrEmpty($AddressLine1))) { $Company.company.add('address_line_1', $AddressLine1) } 113 | if (-not ([string]::IsNullOrEmpty($AddressLine2))) { $Company.company.add('address_line_2', $AddressLine2) } 114 | if (-not ([string]::IsNullOrEmpty($City))) { $Company.company.add('city', $City) } 115 | if (-not ([string]::IsNullOrEmpty($State))) { $Company.company.add('state', $State) } 116 | if (-not ([string]::IsNullOrEmpty($Zip))) { $Company.company.add('zip', $Zip) } 117 | if (-not ([string]::IsNullOrEmpty($CountryName))) { $Company.company.add('country_name', $CountryName) } 118 | if (-not ([string]::IsNullOrEmpty($PhoneNumber))) { $Company.company.add('phone_number', $PhoneNumber) } 119 | if (-not ([string]::IsNullOrEmpty($FaxNumber))) { $Company.company.add('fax_number', $FaxNumber) } 120 | if (-not ([string]::IsNullOrEmpty($Website))) { $Company.company.add('website', $Website) } 121 | if (-not ([string]::IsNullOrEmpty($IdNumber))) { $Company.company.add('id_number', $IdNumber) } 122 | if (-not ([string]::IsNullOrEmpty($ParentCompanyId))) { $Company.company.add('parent_company_id', $ParentCompanyId) } 123 | if (-not ([string]::IsNullOrEmpty($Notes))) { $Company.company.add('notes', $Notes) } 124 | if (-not ([string]::IsNullOrEmpty($Slug))) { $Company.company.add('slug', $Slug) } 125 | 126 | $JSON = $Company | ConvertTo-Json -Depth 10 127 | Write-Verbose $JSON 128 | 129 | if ($PSCmdlet.ShouldProcess($Name)) { 130 | Invoke-HuduRequest -Method post -Resource '/api/v1/companies' -Body $JSON 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduCustomHeaders.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduCustomHeaders { 2 | <# 3 | .SYNOPSIS 4 | Set Hudu custom headers to be injected into each request 5 | 6 | .DESCRIPTION 7 | There may be times when one might need to use custom headers e.g. Service Tokens for Cloudflare Zero Trust 8 | 9 | .PARAMETER Headers 10 | Hashtable with the Custom Headers that need to be injected into each request 11 | 12 | .EXAMPLE 13 | New-HuduCustomHeaders -Headers @{"CF-Access-Client-Id" = "x"; "CF-Access-Client-Secret" = "y"} 14 | 15 | .NOTES 16 | General notes 17 | #> 18 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function')] 19 | [CmdletBinding()] 20 | Param ( 21 | [Parameter(Mandatory = $true, 22 | ValueFromPipeline = $true)] 23 | [hashtable] 24 | $Headers 25 | ) 26 | process { 27 | if ($Headers.Count -eq 0) { 28 | Write-Host "Empty Custom Header hashtable was provided, no Custom Headers will be set" 29 | return 0 30 | } 31 | 32 | Set-Variable -Name 'Int_HuduCustomHeaders' -Value $Headers -Visibility Private -Scope script -Force 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduFolder.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduFolder { 2 | <# 3 | .SYNOPSIS 4 | Create a Folder 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create a new folder 8 | 9 | .PARAMETER Name 10 | Name of the folder 11 | 12 | .PARAMETER Icon 13 | Folder Icon 14 | 15 | .PARAMETER Description 16 | Folder description 17 | 18 | .PARAMETER ParentFolderId 19 | Parent folder ID 20 | 21 | .PARAMETER CompanyId 22 | Company id 23 | 24 | .EXAMPLE 25 | New-HuduFolder -Name 'Test folder' -CompanyId 1 26 | 27 | #> 28 | [CmdletBinding(SupportsShouldProcess)] 29 | Param ( 30 | [Parameter(Mandatory = $true)] 31 | [String]$Name, 32 | [String]$Icon = '', 33 | [String]$Description = '', 34 | [Alias('parent_folder_id')] 35 | [Int]$ParentFolderId = '', 36 | [Alias('company_id')] 37 | [Int]$CompanyId = '' 38 | ) 39 | 40 | $Folder = [ordered]@{folder = [ordered]@{} } 41 | 42 | $Folder.folder.add('name', $Name) 43 | 44 | if ($Icon) { 45 | $Folder.folder.add('icon', $Icon) 46 | } 47 | 48 | if ($Description) { 49 | $Folder.folder.add('description', $Description) 50 | } 51 | 52 | if ($ParentFolderId) { 53 | $Folder.folder.add('parent_folder_id', $ParentFolderId) 54 | } 55 | 56 | if ($CompanyId) { 57 | $Folder.folder.add('company_id', $CompanyId) 58 | } 59 | 60 | $JSON = $Folder | ConvertTo-Json 61 | 62 | if ($PSCmdlet.ShouldProcess($Name)) { 63 | Invoke-HuduRequest -Method post -Resource '/api/v1/folders' -Body $JSON 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduPassword.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduPassword { 2 | <# 3 | .SYNOPSIS 4 | Create a Password 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create a new password 8 | 9 | .PARAMETER Name 10 | Name of the password 11 | 12 | .PARAMETER CompanyId 13 | Company id 14 | 15 | .PARAMETER PasswordableType 16 | Asset type for the password 17 | 18 | .PARAMETER PasswordableId 19 | Asset id for the password 20 | 21 | .PARAMETER InPortal 22 | Boolean for in portal 23 | 24 | .PARAMETER Password 25 | Password 26 | 27 | .PARAMETER OTPSecret 28 | OTP secret 29 | 30 | .PARAMETER URL 31 | Password URL 32 | 33 | .PARAMETER Username 34 | Username 35 | 36 | .PARAMETER Description 37 | Password description 38 | 39 | .PARAMETER PasswordType 40 | Password type 41 | 42 | .PARAMETER PasswordFolderId 43 | Password folder id 44 | 45 | .PARAMETER Slug 46 | Url identifier 47 | 48 | .EXAMPLE 49 | New-HuduPassword -Name 'Some website password' -Username 'user@domain.com' -Password '12345' 50 | 51 | #> 52 | [CmdletBinding(SupportsShouldProcess)] 53 | # This will silence the warning for variables with Password in their name. 54 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '')] 55 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUsernameAndPasswordParams', '')] 56 | Param ( 57 | [Parameter(Mandatory = $true)] 58 | [String]$Name, 59 | 60 | [Alias('company_id')] 61 | [Parameter(Mandatory = $true)] 62 | [Int]$CompanyId, 63 | 64 | [Alias('passwordable_type')] 65 | [String]$PasswordableType = '', 66 | 67 | [Alias('passwordable_id')] 68 | [int]$PasswordableId = '', 69 | 70 | [Alias('in_portal')] 71 | [Bool]$InPortal = $false, 72 | 73 | [Parameter(Mandatory = $true)] 74 | [String]$Password = '', 75 | 76 | [Alias('otp_secret')] 77 | [string]$OTPSecret = '', 78 | 79 | [String]$URL = '', 80 | 81 | [String]$Username = '', 82 | 83 | [String]$Description = '', 84 | 85 | [Alias('password_type')] 86 | [String]$PasswordType = '', 87 | 88 | [Alias('password_folder_id')] 89 | [int]$PasswordFolderId, 90 | 91 | [string]$Slug 92 | ) 93 | 94 | $AssetPassword = [ordered]@{asset_password = [ordered]@{} } 95 | 96 | $AssetPassword.asset_password.add('name', $Name) 97 | $AssetPassword.asset_password.add('company_id', $CompanyId) 98 | $AssetPassword.asset_password.add('password', $Password) 99 | $AssetPassword.asset_password.add('in_portal', $InPortal) 100 | 101 | if ($PasswordableType) { 102 | $AssetPassword.asset_password.add('passwordable_type', $PasswordableType) 103 | } 104 | if ($PasswordableId) { 105 | $AssetPassword.asset_password.add('passwordable_id', $PasswordableId) 106 | } 107 | 108 | if ($OTPSecret) { 109 | $AssetPassword.asset_password.add('otp_secret', $OTPSecret) 110 | } 111 | 112 | if ($URL) { 113 | $AssetPassword.asset_password.add('url', $URL) 114 | } 115 | 116 | if ($Username) { 117 | $AssetPassword.asset_password.add('username', $Username) 118 | } 119 | 120 | if ($Description) { 121 | $AssetPassword.asset_password.add('description', $Description) 122 | } 123 | 124 | if ($PasswordType) { 125 | $AssetPassword.asset_password.add('password_type', $PasswordType) 126 | } 127 | 128 | if ($PasswordFolderId) { 129 | $AssetPassword.asset_password.add('password_folder_id', $PasswordFolderId) 130 | } 131 | 132 | if ($Slug) { 133 | $AssetPassword.asset_password.add('slug', $Slug) 134 | } 135 | 136 | $JSON = $AssetPassword | ConvertTo-Json -Depth 10 137 | 138 | if ($PSCmdlet.ShouldProcess($Name)) { 139 | Invoke-HuduRequest -Method post -Resource '/api/v1/asset_passwords' -Body $JSON 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduPublicPhoto.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduPublicPhoto { 2 | <# 3 | .SYNOPSIS 4 | Create a Public Photo 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to upload an image for use in an asset or article 8 | 9 | .PARAMETER FilePath 10 | Path to the image 11 | 12 | .PARAMETER RecordId 13 | Record id to associate with the photo 14 | 15 | .PARAMETER RecordType 16 | Record type to associate with the photo 17 | 18 | .EXAMPLE 19 | New-HuduPublicPhoto -FilePath 'c:\path\to\image.png' -RecordId 1 -RecordType 'asset' 20 | 21 | #> 22 | [CmdletBinding(SupportsShouldProcess)] 23 | param( 24 | [Parameter(Mandatory)] 25 | [string]$FilePath, 26 | 27 | [Alias('record_id')] 28 | [int]$RecordId, 29 | 30 | [Alias('record_type')] 31 | [string]$RecordType 32 | ) 33 | 34 | $File = Get-Item $FilePath 35 | $form = @{ 36 | photo = $File 37 | } 38 | 39 | if ($RecordId) { $form['record_id'] = $RecordId } 40 | if ($RecordType) { $form['record_type'] = $RecordType } 41 | 42 | if ($PSCmdlet.ShouldProcess($File.FullName)) { 43 | Invoke-HuduRequest -Method POST -Resource '/api/v1/public_photos' -Form $form 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduRelation.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduRelation { 2 | <# 3 | .SYNOPSIS 4 | Create a Relation 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create relationships between objects 8 | 9 | .PARAMETER Description 10 | Give a description to the relation so you know why two things are related 11 | 12 | .PARAMETER FromableType 13 | The type of the FROM relation (Asset, Website, Procedure, AssetPassword, Company, Article) 14 | 15 | .PARAMETER FromableID 16 | The ID of the FROM relation 17 | 18 | .PARAMETER ToableType 19 | The type of the TO relation (Asset, Website, Procedure, AssetPassword, Company, Article) 20 | 21 | .PARAMETER ToableID 22 | The ID of the TO relation 23 | 24 | .PARAMETER IsInverse 25 | When a relation is created, it will also create another relation that is the inverse. When this is true, this relation is the inverse. 26 | 27 | .EXAMPLE 28 | An example 29 | 30 | .NOTES 31 | General notes 32 | #> 33 | [CmdletBinding(SupportsShouldProcess)] 34 | Param ( 35 | [String]$Description, 36 | 37 | [Parameter(Mandatory = $true)] 38 | [ValidateSet('Asset', 'Website', 'Procedure', 'AssetPassword', 'Company', 'Article')] 39 | [Alias('fromable_type')] 40 | [String]$FromableType, 41 | 42 | [Alias('fromable_id')] 43 | [int]$FromableID, 44 | 45 | [Alias('toable_type')] 46 | [String]$ToableType, 47 | 48 | [Alias('toable_id')] 49 | [int]$ToableID, 50 | 51 | [Alias('is_inverse')] 52 | [string]$IsInverse 53 | ) 54 | 55 | $Relation = [ordered]@{relation = [ordered]@{} } 56 | 57 | $Relation.relation.add('fromable_type', $FromableType) 58 | $Relation.relation.add('fromable_id', $FromableID) 59 | $Relation.relation.add('toable_type', $ToableType) 60 | $Relation.relation.add('toable_id', $ToableID) 61 | 62 | if ($Description) { 63 | $Relation.relation.add('description', $Description) 64 | } 65 | 66 | if ($ISInverse) { 67 | $Relation.relation.add('is_inverse', $ISInverse) 68 | } 69 | 70 | $JSON = $Relation | ConvertTo-Json -Depth 100 71 | 72 | if ($PSCmdlet.ShouldProcess($FromableType)) { 73 | Invoke-HuduRequest -Method post -Resource '/api/v1/relations' -Body $JSON 74 | } 75 | } -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduUpload.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduUpload { 2 | <# 3 | .SYNOPSIS 4 | Create a Upload 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to upload a file for use in an asset. RecordType can be of 'asset','website','procedure','assetpassword','comapny','article'. 8 | 9 | .PARAMETER FilePath 10 | Path to the file 11 | 12 | .PARAMETER RecordId 13 | Record id to associate with the Upload 14 | 15 | .PARAMETER RecordType 16 | Record type to associate with the Upload 17 | 18 | .EXAMPLE 19 | New-HuduUpload -FilePath 'c:\path\to\file.png' -RecordId 1 -RecordType 'asset' 20 | 21 | #> 22 | [CmdletBinding(SupportsShouldProcess)] 23 | param( 24 | [Parameter(Mandatory)] 25 | [string]$FilePath, 26 | 27 | [Parameter(Mandatory)] 28 | [Alias('record_id','recordid')] 29 | [int]$uploadable_id, 30 | 31 | [Parameter(Mandatory)] 32 | [Alias('record_type','recordtype')] 33 | [ValidateSet('Asset', 'Website', 'Procedure', 'AssetPassword', 'Company', 'Article')] 34 | [string]$uploadable_type 35 | ) 36 | 37 | $File = Get-Item $FilePath 38 | 39 | $form = @{ 40 | file = $File 41 | "upload[uploadable_id]" = $uploadable_id 42 | "upload[uploadable_type]" = $uploadable_type 43 | } 44 | 45 | if ($PSCmdlet.ShouldProcess($File.FullName)) { 46 | Invoke-HuduRequest -Method POST -Resource '/api/v1/uploads' -Form $form 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /HuduAPI/Public/New-HuduWebsite.ps1: -------------------------------------------------------------------------------- 1 | function New-HuduWebsite { 2 | <# 3 | .SYNOPSIS 4 | Create a Website 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to create a website 8 | 9 | .PARAMETER Name 10 | Website name (e.g. https://domain.com) 11 | 12 | .PARAMETER Notes 13 | Used to add additional notes to a website 14 | 15 | .PARAMETER Paused 16 | When true, website monitoring is paused 17 | 18 | .PARAMETER CompanyId 19 | Used to associate website with company 20 | 21 | .PARAMETER DisableDNS 22 | When true, dns monitoring is paused. 23 | 24 | .PARAMETER DisableSSL 25 | When true, ssl cert monitoring is paused. 26 | 27 | .PARAMETER DisableWhois 28 | When true, whois monitoring is paused. 29 | 30 | .PARAMETER Slug 31 | Url identifier 32 | 33 | .EXAMPLE 34 | New-HuduWebsite -CompanyId 1 -Name https://domain.com 35 | 36 | #> 37 | [CmdletBinding(SupportsShouldProcess)] 38 | Param ( 39 | [Parameter(Mandatory = $true)] 40 | [String]$Name, 41 | 42 | [String]$Notes = '', 43 | 44 | [String]$Paused = '', 45 | 46 | [Alias('company_id')] 47 | [Parameter(Mandatory = $true)] 48 | [Int]$CompanyId, 49 | 50 | [Alias('disable_dns')] 51 | [String]$DisableDNS = '', 52 | 53 | [Alias('disable_ssl')] 54 | [String]$DisableSSL = '', 55 | 56 | [Alias('disable_whois')] 57 | [String]$DisableWhois = '', 58 | 59 | [string]$Slug 60 | ) 61 | 62 | $Website = [ordered]@{website = [ordered]@{} } 63 | 64 | $Website.website.add('name', $Name) 65 | 66 | if ($Notes) { 67 | $Website.website.add('notes', $Notes) 68 | } 69 | 70 | if ($Paused) { 71 | $Website.website.add('paused', $Paused) 72 | } 73 | 74 | $Website.website.add('company_id', $CompanyId) 75 | 76 | if ($DisableDNS) { 77 | $Website.website.add('disable_dns', $DisableDNS) 78 | } 79 | 80 | if ($DisableSSL) { 81 | $Website.website.add('disable_ssl', $DisableSSL) 82 | } 83 | 84 | if ($DisableWhois) { 85 | $Website.website.add('disable_whois', $DisableWhois) 86 | } 87 | 88 | if ($Slug) { 89 | $Website.website.add('slug', $Slug) 90 | } 91 | 92 | $JSON = $Website | ConvertTo-Json 93 | 94 | if ($PSCmdlet.ShouldProcess($Name)) { 95 | Invoke-HuduRequest -Method post -Resource '/api/v1/websites' -Body $JSON 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduAPIKey.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduAPIKey { 2 | <# 3 | .SYNOPSIS 4 | Remove API key 5 | 6 | .DESCRIPTION 7 | Unsets the variable for the Hudu API Key 8 | 9 | .EXAMPLE 10 | Remove-HuduAPIKey 11 | 12 | #> 13 | [CmdletBinding(SupportsShouldProcess)] 14 | Param() 15 | 16 | if ($PSCmdlet.ShouldProcess('API Key')) { 17 | Remove-Variable -Name 'Int_HuduAPIKey' -Scope script -Force 18 | } 19 | } -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduArticle.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduArticle { 2 | <# 3 | .SYNOPSIS 4 | Delete a Knowledge Base Article 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to remove a KB article 8 | 9 | .PARAMETER Id 10 | Id of the requested article 11 | 12 | .EXAMPLE 13 | Remove-HuduArticle -Id 1 14 | 15 | .NOTES 16 | General notes 17 | #> 18 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 19 | Param ( 20 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 21 | [Int]$Id 22 | ) 23 | process { 24 | if ($PSCmdlet.ShouldProcess($Id)) { 25 | Invoke-HuduRequest -Method delete -Resource "/api/v1/articles/$Id" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduAsset.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduAsset { 2 | <# 3 | .SYNOPSIS 4 | Delete an Asset 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to remove an Asset from a company 8 | 9 | .PARAMETER Id 10 | Id of the requested Asset 11 | 12 | .PARAMETER CompanyId 13 | Id of the requested parent Company 14 | 15 | .EXAMPLE 16 | Remove-HuduAsset -CompanyId 1 -Id 1 17 | 18 | #> 19 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 20 | Param ( 21 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 22 | [Int]$Id, 23 | [Alias('company_id')] 24 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 25 | [Int]$CompanyId 26 | ) 27 | 28 | process { 29 | if ($PSCmdlet.ShouldProcess($Id)) { 30 | Invoke-HuduRequest -Method delete -Resource "/api/v1/companies/$CompanyId/assets/$Id" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduBaseURL.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduBaseURL { 2 | <# 3 | .SYNOPSIS 4 | Remove base URL 5 | 6 | .DESCRIPTION 7 | Unsets the Hudu Base URL variable 8 | 9 | .EXAMPLE 10 | Remove-HuduBaseURL 11 | 12 | #> 13 | [CmdletBinding(SupportsShouldProcess)] 14 | Param() 15 | if ($PSCmdlet.ShouldProcess('Base URL')) { 16 | Remove-Variable -Name 'Int_HuduBaseURL' -Scope script -Force 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduCompany.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduCompany { 2 | <# 3 | .SYNOPSIS 4 | Delete a Website 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to delete a company 8 | 9 | .PARAMETER Id 10 | Id of the Company to delete 11 | 12 | .EXAMPLE 13 | Remove-HuduCompany -Id 1 14 | 15 | #> 16 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 17 | Param ( 18 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 19 | [Int]$Id 20 | ) 21 | 22 | process { 23 | if ($PSCmdlet.ShouldProcess($Id)) { 24 | Invoke-HuduRequest -Method delete -Resource "/api/v1/companies/$Id" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduCustomHeaders.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduCustomHeaders { 2 | <# 3 | .SYNOPSIS 4 | Remove Custom Headers that are injected into each request 5 | 6 | .DESCRIPTION 7 | Unsets the Hudu Custom Header variable 8 | 9 | .EXAMPLE 10 | Remove-HuduCustomHeaders 11 | 12 | #> 13 | [CmdletBinding(SupportsShouldProcess)] 14 | Param() 15 | if ($PSCmdlet.ShouldProcess('Custom Headers')) { 16 | Remove-Variable -Name 'Int_HuduCustomHeaders' -Scope script -Force 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduMagicDash.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduMagicDash { 2 | <# 3 | .SYNOPSIS 4 | Delete a Magic Dash Item 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to remove Magic Dash by Id or Title and Company Name 8 | 9 | .PARAMETER Title 10 | Title of the Magic Dash 11 | 12 | .PARAMETER CompanyName 13 | Company Name 14 | 15 | .PARAMETER Id 16 | Id of the Magic Dash 17 | 18 | .EXAMPLE 19 | Remove-HuduMagicDash -Id 1 20 | 21 | .EXAMPLE 22 | Remove-HuduMagicDash -Title 'Microsoft 365' -CompanyName 'AcmeCorp' 23 | 24 | #> 25 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High', DefaultParameterSetName = 'Id')] 26 | Param ( 27 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, ParameterSetName = 'TitleCompany')] 28 | [String]$Title, 29 | 30 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, ParameterSetName = 'TitleCompany')] 31 | [Alias('company_name')] 32 | [String]$CompanyName, 33 | 34 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, ParameterSetName = 'Id')] 35 | [int]$Id 36 | ) 37 | 38 | process { 39 | if ($id) { 40 | if ($PSCmdlet.ShouldProcess($Id)) { 41 | $null = Invoke-HuduRequest -Method delete -Resource "/api/v1/magic_dash/$Id" 42 | } 43 | } else { 44 | $MagicDash = @{} 45 | 46 | $MagicDash.add('title', $Title) 47 | $MagicDash.add('company_name', $CompanyName) 48 | 49 | $JSON = $MagicDash | ConvertTo-Json 50 | 51 | if ($PSCmdlet.ShouldProcess("$Company - $Title")) { 52 | $null = Invoke-HuduRequest -Method delete -Resource '/api/v1/magic_dash' -Body $JSON 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduPassword.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduPassword { 2 | <# 3 | .SYNOPSIS 4 | Delete a Password 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to remove asset password 8 | 9 | .PARAMETER Id 10 | Id of the password 11 | 12 | .EXAMPLE 13 | Remove-HuduPassword -Id 1 14 | 15 | #> 16 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 17 | Param ( 18 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 19 | [Int]$Id 20 | ) 21 | process { 22 | if ($PSCmdlet.ShouldProcess($Id)) { 23 | Invoke-HuduRequest -Method delete -Resource "/api/v1/asset_passwords/$Id" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduRelation.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduRelation { 2 | <# 3 | .SYNOPSIS 4 | Delete a Relation 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to delete object relationships 8 | 9 | .PARAMETER Id 10 | Id of the requested Relation 11 | 12 | .EXAMPLE 13 | Remove-HuduRelation -Id 1 14 | 15 | #> 16 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 17 | Param ( 18 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 19 | [Int]$Id 20 | ) 21 | 22 | process { 23 | if ($PSCmdlet.ShouldProcess($Id)) { 24 | Invoke-HuduRequest -Method delete -Resource "/api/v1/relations/$Id" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduUpload.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduUpload { 2 | <# 3 | .SYNOPSIS 4 | Delete an Upload by ID 5 | 6 | .DESCRIPTION 7 | Calls Hudu API to delete uploads by specifying the ID value 8 | 9 | .EXAMPLE 10 | Remove-HuduUpload 11 | 12 | #> 13 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 14 | Param( 15 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 16 | [Int]$Id 17 | ) 18 | 19 | process { 20 | if ($PSCmdlet.ShouldProcess($Id)) { 21 | Invoke-HuduRequest -Method delete -Resource "/api/v1/uploads/$Id" 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /HuduAPI/Public/Remove-HuduWebsite.ps1: -------------------------------------------------------------------------------- 1 | function Remove-HuduWebsite { 2 | <# 3 | .SYNOPSIS 4 | Delete a Website 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to delete a website 8 | 9 | .PARAMETER Id 10 | Id of the requested Website 11 | 12 | .EXAMPLE 13 | Remove-HuduWebsite -Id 1 14 | 15 | #> 16 | [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] 17 | Param ( 18 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 19 | [Int]$Id 20 | ) 21 | 22 | process { 23 | if ($PSCmdlet.ShouldProcess($Id)) { 24 | Invoke-HuduRequest -Method delete -Resource "/api/v1/websites/$Id" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduArticle.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduArticle { 2 | <# 3 | .SYNOPSIS 4 | Update a Knowledge Base Article 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to update KB Article 8 | 9 | .PARAMETER Name 10 | Name of the Article 11 | 12 | .PARAMETER Content 13 | Article Content 14 | 15 | .PARAMETER EnableSharing 16 | Set article to public and generate a URL 17 | 18 | .PARAMETER FolderId 19 | Used to associate article with folder 20 | 21 | .PARAMETER CompanyId 22 | Used to associate article with company 23 | 24 | .PARAMETER ArticleId 25 | Id of the requested article 26 | 27 | .PARAMETER Slug 28 | Url identifier 29 | 30 | .EXAMPLE 31 | Set-HuduArticle -ArticleId 1 -Name 'Article Name' -Content '

New article contents

' 32 | 33 | #> 34 | [CmdletBinding(SupportsShouldProcess)] 35 | Param ( 36 | [String]$Name, 37 | 38 | [String]$Content, 39 | [switch]$EnableSharing, 40 | 41 | [Alias('folder_id')] 42 | [Int]$FolderId = '', 43 | 44 | [Alias('company_id')] 45 | [Int]$CompanyId = '', 46 | 47 | [Alias('article_id', 'id')] 48 | [Parameter(Mandatory = $true)] 49 | [Int]$ArticleId, 50 | 51 | [string]$Slug 52 | ) 53 | 54 | $Object = Get-HuduArticles -Id $ArticleId 55 | $Article = [ordered]@{article = $Object.article } 56 | 57 | if ($Name) { 58 | $Article.article.name = $Name 59 | } 60 | 61 | if ($Content) { 62 | $Article.article.content = $Content 63 | } 64 | 65 | if ($FolderId) { 66 | $Article.article.folder_id = $FolderId 67 | } 68 | 69 | if ($CompanyId) { 70 | $Article.article.company_id = $CompanyId 71 | } 72 | 73 | if ($EnableSharing.IsPresent) { 74 | $Article.article.enable_sharing = $true 75 | } 76 | 77 | if ($Slug) { 78 | $Article.article.slug = $Slug 79 | } 80 | 81 | $JSON = $Article | ConvertTo-Json -Depth 10 82 | 83 | if ($PSCmdlet.ShouldProcess($Name)) { 84 | Invoke-HuduRequest -Method put -Resource "/api/v1/articles/$ArticleId" -Body $JSON 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduArticleArchive.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduArticleArchive { 2 | <# 3 | .SYNOPSIS 4 | Archive/Unarchive a Knowledge Base Article 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to archive or unarchive an article 8 | 9 | .PARAMETER Id 10 | Id of the requested article 11 | 12 | .PARAMETER Archive 13 | Boolean for archive status 14 | 15 | .EXAMPLE 16 | Set-HuduArticleArchive -Id 1 -Archive $true 17 | 18 | #> 19 | [CmdletBinding(SupportsShouldProcess)] 20 | Param ( 21 | [Parameter(Mandatory = $true)] 22 | [Int]$Id, 23 | [Parameter(Mandatory = $true)] 24 | [Bool]$Archive 25 | ) 26 | 27 | if ($Archive) { 28 | $Action = 'archive' 29 | } else { 30 | $Action = 'unarchive' 31 | } 32 | 33 | if ($PSCmdlet.ShouldProcess($Id)) { 34 | Invoke-HuduRequest -Method put -Resource "/api/v1/articles/$Id/$Action" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduAsset.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduAsset { 2 | <# 3 | .SYNOPSIS 4 | Update an Asset 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to update an Asset 8 | 9 | .PARAMETER Name 10 | Name of the Asset 11 | 12 | .PARAMETER CompanyId 13 | Company id of the Asset 14 | 15 | .PARAMETER AssetLayoutId 16 | Asset layout id 17 | 18 | .PARAMETER Fields 19 | List of fields 20 | 21 | .PARAMETER AssetId 22 | Id of the requested Asset 23 | 24 | .PARAMETER PrimarySerial 25 | Primary serial number 26 | 27 | .PARAMETER PrimaryMail 28 | Primary mail 29 | 30 | .PARAMETER PrimaryModel 31 | Primary model 32 | 33 | .PARAMETER PrimaryManufacturer 34 | Primary manufacturer 35 | 36 | .PARAMETER Slug 37 | Url identifier 38 | 39 | .EXAMPLE 40 | Set-HuduAsset -AssetId 1 -CompanyId 1 -Fields @(@{'field_name'='Field Value'}) 41 | 42 | .NOTES 43 | General notes 44 | #> 45 | [CmdletBinding(SupportsShouldProcess)] 46 | Param ( 47 | [String]$Name, 48 | 49 | [Alias('company_id')] 50 | [Int]$CompanyId, 51 | 52 | [Alias('asset_layout_id')] 53 | [Int]$AssetLayoutId, 54 | 55 | [Array]$Fields, 56 | 57 | [Alias('asset_id','assetid')] 58 | [Parameter(Mandatory = $true)] 59 | [ValidateRange(1, [int]::MaxValue)] 60 | [Int]$Id, 61 | 62 | [Alias('primary_serial')] 63 | [string]$PrimarySerial, 64 | 65 | [Alias('primary_mail')] 66 | [string]$PrimaryMail, 67 | 68 | [Alias('primary_model')] 69 | [string]$PrimaryModel, 70 | 71 | [Alias('primary_manufacturer')] 72 | [string]$PrimaryManufacturer, 73 | 74 | [string]$Slug 75 | ) 76 | 77 | $Object = Get-HuduAssets -id $Id | Select-Object name,asset_layout_id,company_id,slug,primary_serial,primary_model,primary_mail,id,primary_manufacturer,@{n='custom_fields';e={$_.fields | ForEach-Object {[pscustomobject]@{$_.label.replace(' ','_').tolower()= $_.value}}}} 78 | if ($Object) { 79 | $Asset = [ordered]@{asset = $Object } 80 | $CompanyId = $Object.company_id 81 | 82 | if ($Name) { 83 | $Asset.asset.name = $Name 84 | } 85 | 86 | if ($AssetLayoutId) { 87 | $Asset.asset.asset_layout_id = $AssetLayoutId 88 | } 89 | 90 | if ($PrimarySerial) { 91 | $Asset.asset.primary_serial = $PrimarySerial 92 | } 93 | 94 | if ($PrimaryMail) { 95 | $Asset.asset.primary_mail = $PrimaryMail 96 | } 97 | 98 | if ($PrimaryModel) { 99 | $Asset.asset.primary_model = $PrimaryModel 100 | } 101 | 102 | if ($PrimaryManufacturer) { 103 | $Asset.asset.primary_manufacturer = $PrimaryManufacturer 104 | } 105 | 106 | if ($Fields) { 107 | $Asset.asset.custom_fields = $Fields 108 | } 109 | 110 | if ($Slug) { 111 | $Asset.asset.slug = $Slug 112 | } 113 | 114 | $JSON = $Asset | ConvertTo-Json -Depth 10 115 | 116 | if ($PSCmdlet.ShouldProcess("ID: $($Asset.id) Name: $($Asset.Name)", "Set Hudu Asset")) { 117 | Invoke-HuduRequest -Method put -Resource "/api/v1/companies/$CompanyId/assets/$Id" -Body $JSON 118 | } 119 | } else { 120 | throw "A valid asset could not be found to update, please double check the ID and try again" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduAssetArchive.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduAssetArchive { 2 | <# 3 | .SYNOPSIS 4 | Archive/Unarchive an Asset 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to archive or unarchive an asset 8 | 9 | .PARAMETER Id 10 | Id of the requested Asset 11 | 12 | .PARAMETER CompanyId 13 | Id of the requested parent company 14 | 15 | .PARAMETER Archive 16 | Boolean for archive status 17 | 18 | .EXAMPLE 19 | Set-HuduAssetArchive -Id 1 -CompanyId 1 -Archive $true 20 | 21 | #> 22 | [CmdletBinding(SupportsShouldProcess)] 23 | Param ( 24 | [Parameter(Mandatory = $true)] 25 | [Int]$Id, 26 | [Alias('company_id')] 27 | [Parameter(Mandatory = $true)] 28 | [Int]$CompanyId, 29 | [Parameter(Mandatory = $true)] 30 | [Bool]$Archive 31 | ) 32 | 33 | if ($Archive) { 34 | $Action = 'archive' 35 | } else { 36 | $Action = 'unarchive' 37 | } 38 | 39 | if ($PSCmdlet.ShouldProcess($Id)) { 40 | Invoke-HuduRequest -Method put -Resource "/api/v1/companies/$CompanyId/assets/$Id/$Action" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduCompany.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduCompany { 2 | <# 3 | .SYNOPSIS 4 | Update a company 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to update a Company 8 | 9 | .PARAMETER Id 10 | Id of the requested company 11 | 12 | .PARAMETER Name 13 | Name of the company 14 | 15 | .PARAMETER Nickname 16 | Nickname of the company 17 | 18 | .PARAMETER CompanyType 19 | Company type 20 | 21 | .PARAMETER AddressLine1 22 | Address line 1 23 | 24 | .PARAMETER AddressLine2 25 | Address line 2 26 | 27 | .PARAMETER City 28 | City 29 | 30 | .PARAMETER State 31 | State 32 | 33 | .PARAMETER Zip 34 | Zip 35 | 36 | .PARAMETER CountryName 37 | Country name 38 | 39 | .PARAMETER PhoneNumber 40 | Phone number 41 | 42 | .PARAMETER FaxNumber 43 | Fax number 44 | 45 | .PARAMETER Website 46 | Webste 47 | 48 | .PARAMETER IdNumber 49 | Id number 50 | 51 | .PARAMETER ParentCompanyId 52 | Parent company id 53 | 54 | .PARAMETER Notes 55 | Company notes 56 | 57 | .PARAMETER Slug 58 | Url identifier 59 | 60 | .EXAMPLE 61 | Set-HuduCompany -Id 1 -Name 'New company name' 62 | 63 | #> 64 | [CmdletBinding(SupportsShouldProcess)] 65 | Param ( 66 | [Parameter(Mandatory = $true)] 67 | [Int]$Id, 68 | 69 | [String]$Name, 70 | 71 | [String]$Nickname = '', 72 | 73 | [Alias('company_type')] 74 | [String]$CompanyType = '', 75 | 76 | [Alias('address_line_1')] 77 | [String]$AddressLine1 = '', 78 | 79 | [Alias('address_line_2')] 80 | [String]$AddressLine2 = '', 81 | 82 | [String]$City = '', 83 | 84 | [String]$State = '', 85 | 86 | [Alias('PostalCode', 'PostCode')] 87 | [String]$Zip = '', 88 | 89 | [Alias('country_name')] 90 | [String]$CountryName = '', 91 | 92 | [Alias('phone_number')] 93 | [String]$PhoneNumber = '', 94 | 95 | [Alias('fax_number')] 96 | [String]$FaxNumber = '', 97 | 98 | [String]$Website = '', 99 | 100 | [Alias('id_number')] 101 | [String]$IdNumber = '', 102 | 103 | [Alias('parent_company_id')] 104 | [Int]$ParentCompanyId, 105 | 106 | [String]$Notes = '', 107 | 108 | [string]$Slug 109 | ) 110 | 111 | $Object = Get-HuduCompanies -Id $Id 112 | 113 | $Company = [ordered]@{company = $Object } 114 | 115 | if ($Name) { 116 | $Company.company.name = $Name 117 | } 118 | 119 | if ($Nickname) { 120 | $Company.company.nickname = $Nickname 121 | } 122 | 123 | if ($CompanyType) { 124 | $Company.company.company_type = $CompanyType 125 | } 126 | 127 | if ($AddressLine1) { 128 | $Company.company.address_line_1 = $AddressLine1 129 | } 130 | 131 | if ($AddressLine2) { 132 | $Company.company.address_line_2 = $AddressLine2 133 | } 134 | 135 | if ($City) { 136 | $Company.company.city = $City 137 | } 138 | 139 | if ($State) { 140 | $Company.company.state = $State 141 | } 142 | 143 | if ($Zip) { 144 | $Company.company.zip = $Zip 145 | } 146 | 147 | if ($CountryName) { 148 | $Company.company.country_name = $CountryName 149 | } 150 | 151 | if ($PhoneNumber) { 152 | $Company.company.phone_number = $PhoneNumber 153 | } 154 | 155 | if ($FaxNumber) { 156 | $Company.company.fax_number = $FaxNumber 157 | } 158 | 159 | if ($Website) { 160 | $Company.company.website = $Website 161 | } 162 | 163 | if ($IdNumber) { 164 | $Company.company.id_number = $IdNumber 165 | } 166 | 167 | if ($ParentCompanyId) { 168 | $Company.company.parent_company_id = $ParentCompanyId 169 | } 170 | 171 | if ($Notes) { 172 | $Company.company.notes = $Notes 173 | } 174 | 175 | if ($Slug) { 176 | $Company.company.slug = $Slug 177 | } 178 | 179 | $JSON = $Company | ConvertTo-Json -Depth 10 180 | 181 | if ($PSCmdlet.ShouldProcess($Id)) { 182 | Invoke-HuduRequest -Method put -Resource "/api/v1/companies/$Id" -Body $JSON 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduCompanyArchive.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduCompanyArchive { 2 | <# 3 | .SYNOPSIS 4 | Archive/Unarchive a company 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to set archive status on a company 8 | 9 | .PARAMETER Id 10 | Id of the requested company 11 | 12 | .PARAMETER Archive 13 | Boolean for archive status 14 | 15 | .EXAMPLE 16 | Set-HuduCompanyArchive -Id 1 -Archive $true 17 | 18 | #> 19 | [CmdletBinding(SupportsShouldProcess)] 20 | Param ( 21 | [Parameter(Mandatory = $true)] 22 | [Int]$Id, 23 | [Parameter(Mandatory = $true)] 24 | [Bool]$Archive 25 | ) 26 | 27 | if ($Archive -eq $true) { 28 | $Action = 'archive' 29 | } else { 30 | $Action = 'unarchive' 31 | } 32 | if ($PSCmdlet.ShouldProcess($Id)) { 33 | Invoke-HuduRequest -Method put -Resource "/api/v1/companies/$Id/$Action" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduFolder.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduFolder { 2 | <# 3 | .SYNOPSIS 4 | Update a Folder 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to update a folder 8 | 9 | .PARAMETER Id 10 | Id of the requested folder 11 | 12 | .PARAMETER Name 13 | Name of the folder 14 | 15 | .PARAMETER Icon 16 | Folder icon 17 | 18 | .PARAMETER Description 19 | Folder description 20 | 21 | .PARAMETER ParentFolderId 22 | Folder parent id 23 | 24 | .PARAMETER CompanyId 25 | Folder company id 26 | 27 | .EXAMPLE 28 | Set-HuduFolder -Id 1 -Name 'New folder name' 29 | 30 | #> 31 | [CmdletBinding(SupportsShouldProcess)] 32 | Param ( 33 | [Parameter(Mandatory = $true)] 34 | [Int]$Id, 35 | 36 | [Parameter(Mandatory = $true)] 37 | [String]$Name, 38 | 39 | [String]$Icon = '', 40 | 41 | [String]$Description = '', 42 | 43 | [Alias('parent_folder_id')] 44 | [Int]$ParentFolderId = '', 45 | 46 | [Alias('company_id')] 47 | [Int]$CompanyId = '' 48 | ) 49 | 50 | $Folder = [ordered]@{folder = [ordered]@{} } 51 | 52 | $Folder.folder.add('name', $Name) 53 | 54 | if ($icon) { 55 | $Folder.folder.add('icon', $Icon) 56 | } 57 | 58 | if ($Description) { 59 | $Folder.folder.add('description', $Description) 60 | } 61 | 62 | if ($ParentFolderId) { 63 | $Folder.folder.add('parent_folder_id', $ParentFolderId) 64 | } 65 | 66 | if ($CompanyId) { 67 | $Folder.folder.add('company_id', $CompanyId) 68 | } 69 | 70 | $JSON = $Folder | ConvertTo-Json 71 | 72 | if ($PSCmdlet.ShouldProcess($Id)) { 73 | Invoke-HuduRequest -Method put -Resource "/api/v1/folders/$Id" -Body $JSON 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduIntegrationMatcher.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduIntegrationMatcher { 2 | <# 3 | .SYNOPSIS 4 | Update a Matcher 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to set integration matchers 8 | 9 | .PARAMETER Id 10 | Id of the requested matcher 11 | 12 | .PARAMETER AcceptSuggestedMatch 13 | Set the Sync Id/Identifier to the suggested one 14 | 15 | .PARAMETER CompanyId 16 | Requested company id to match 17 | 18 | .PARAMETER PotentialCompanyId 19 | Potential company id to match 20 | 21 | .PARAMETER SyncId 22 | Sync id to match 23 | 24 | .PARAMETER Identifier 25 | Identifier to match 26 | 27 | .EXAMPLE 28 | Set-HuduIntegrationMatcher -Id 1 -AcceptSuggestedMatch 29 | 30 | #> 31 | [CmdletBinding(SupportsShouldProcess)] 32 | Param ( 33 | [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] 34 | [String]$Id, 35 | 36 | [Parameter(ParameterSetName = 'AcceptSuggestedMatch')] 37 | [switch]$AcceptSuggestedMatch, 38 | 39 | [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'SetCompanyId')] 40 | [Alias('company_id')] 41 | [String]$CompanyId, 42 | 43 | [Parameter(ValueFromPipelineByPropertyName = $true)] 44 | [Alias('potential_company_id')] 45 | [String]$PotentialCompanyId, 46 | 47 | [Parameter(ValueFromPipelineByPropertyName = $true)] 48 | [Alias('sync_id')] 49 | [String]$SyncId, 50 | 51 | [Parameter(ValueFromPipelineByPropertyName = $true)] 52 | [String]$Identifier 53 | ) 54 | 55 | process { 56 | $Matcher = [ordered]@{matcher = [ordered]@{} } 57 | 58 | if ($AcceptSuggestedMatch) { 59 | $Matcher.matcher.add('company_id', $PotentialCompanyId) | Out-Null 60 | } else { 61 | $Matcher.matcher.add('company_id', $CompanyId) | Out-Null 62 | } 63 | 64 | if ($PotentialCompanyId) { 65 | $Matcher.matcher.add('potential_company_id', $PotentialCompanyId) | Out-Null 66 | } 67 | if ($SyncId) { 68 | $Matcher.matcher.add('sync_id', $SyncId) | Out-Null 69 | } 70 | if ($Identifier) { 71 | $Matcher.matcher.add('identifier', $identifier) | Out-Null 72 | } 73 | 74 | $JSON = $Matcher | ConvertTo-Json -Depth 10 75 | 76 | if ($PSCmdlet.ShouldProcess($Id)) { 77 | Invoke-HuduRequest -Method put -Resource "/api/v1/matchers/$Id" -Body $JSON 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduMagicDash.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduMagicDash { 2 | <# 3 | .SYNOPSIS 4 | Create or Update a Magic Dash Item 5 | 6 | .DESCRIPTION 7 | Magic Dash takes just simple key-pairs. Whether you want to add a new Magic Dash Item, or update one, you can use the same endpoint, so it is really easy! It uses the title, and company_name to match. 8 | 9 | .PARAMETER Title 10 | This is the title. If there is an existing Magic Dash Item with matching title and company_name, then it will match into that item. 11 | 12 | .PARAMETER CompanyName 13 | This is the attribute we use to match to an existing company. If there is an existing Magic Dash Item with matching title and company_name, then it will match into that item. 14 | 15 | .PARAMETER Message 16 | This will be the first content that will be displayed on the Magic Dash Item. 17 | 18 | .PARAMETER Icon 19 | Either fill this in, or image_url. Use a (FontAwesome icon for the header of a Magic Dash Item. Must be in the format of fas fa-circle 20 | 21 | .PARAMETER ImageURL 22 | Either fill this in, or icon. Used in the header of a Magic Dash Item. 23 | 24 | .PARAMETER ContentLink 25 | Either fill this in, or content, or leave both blank. Used to have a link to an external website. 26 | 27 | .PARAMETER Content 28 | Either fill this in, or content_link, or leave both blank. Fill in with HTML (tables, images, videos, etc.) to display more content in your Magic Dash Item. 29 | 30 | .PARAMETER Shade 31 | Use a different color for your Magic Dash Item for different contextual states. Options are to leave it blank, success, or danger 32 | 33 | .EXAMPLE 34 | Set-HuduMagicDash -Title 'Test Dash' -CompanyName 'Test Company' -Message 'This will be displayed first' 35 | 36 | #> 37 | [CmdletBinding(SupportsShouldProcess)] 38 | Param ( 39 | [Parameter(Mandatory = $true)] 40 | [String]$Title, 41 | 42 | [Alias('company_name')] 43 | [Parameter(Mandatory = $true)] 44 | [String]$CompanyName, 45 | 46 | [Parameter(Mandatory = $true)] 47 | [String]$Message, 48 | 49 | [String]$Icon = '', 50 | 51 | [Alias('image_url')] 52 | [String]$ImageURL = '', 53 | 54 | [Alias('content_link')] 55 | [String]$ContentLink = '', 56 | 57 | [String]$Content = '', 58 | 59 | [String]$Shade = '' 60 | ) 61 | 62 | if ($Icon -and $ImageURL) { 63 | Write-Error ('You can only use one of icon or image URL') 64 | exit 1 65 | } 66 | 67 | if ($content_link -and $content) { 68 | Write-Error ('You can only use one of content or content_link') 69 | exit 1 70 | } 71 | 72 | $MagicDash = [ordered]@{} 73 | 74 | if ($Title) { 75 | $MagicDash.add('title', $Title) 76 | } 77 | 78 | if ($CompanyName) { 79 | $MagicDash.add('company_name', $CompanyName) 80 | } 81 | 82 | if ($Message) { 83 | $MagicDash.add('message', $Message) 84 | } 85 | 86 | if ($Icon) { 87 | $MagicDash.add('icon', $Icon) 88 | } 89 | 90 | if ($ImageURL) { 91 | $MagicDash.add('image_url', $ImageURL) 92 | } 93 | 94 | if ($ContentLink) { 95 | $MagicDash.add('content_link', $ContentLink) 96 | } 97 | 98 | if ($Content) { 99 | $MagicDash.add('content', $Content) 100 | } 101 | 102 | if ($Shade) { 103 | $MagicDash.add('shade', $Shade) 104 | } 105 | 106 | $JSON = $MagicDash | ConvertTo-Json 107 | 108 | if ($PSCmdlet.ShouldProcess("$Companyname - $Title")) { 109 | Invoke-HuduRequest -Method post -Resource '/api/v1/magic_dash' -Body $JSON 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduPasswordArchive.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduPasswordArchive { 2 | <# 3 | .SYNOPSIS 4 | Archive/Unarchive a Password 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to archive or unarchive a password 8 | 9 | .PARAMETER Id 10 | Id of the requested Password 11 | 12 | .PARAMETER Archive 13 | Boolean of archive status 14 | 15 | .EXAMPLE 16 | Set-HuduPasswordArchive -Archive $true -Id 1 17 | 18 | #> 19 | [CmdletBinding(SupportsShouldProcess)] 20 | Param ( 21 | [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] 22 | [Int]$Id, 23 | [Parameter(Mandatory = $true)] 24 | [Bool]$Archive 25 | ) 26 | 27 | process { 28 | if ($Archive) { 29 | $Action = 'archive' 30 | } else { 31 | $Action = 'unarchive' 32 | } 33 | 34 | if ($PSCmdlet.ShouldProcess($Id)) { 35 | Invoke-HuduRequest -Method put -Resource "/api/v1/asset_passwords/$Id/$Action" 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /HuduAPI/Public/Set-HuduWebsite.ps1: -------------------------------------------------------------------------------- 1 | function Set-HuduWebsite { 2 | <# 3 | .SYNOPSIS 4 | Update a Website 5 | 6 | .DESCRIPTION 7 | Uses Hudu API to update a website 8 | 9 | .PARAMETER Id 10 | Id of requested website 11 | 12 | .PARAMETER Name 13 | Website name (e.g. https://example.com) 14 | 15 | .PARAMETER Notes 16 | Website Notes 17 | 18 | .PARAMETER Paused 19 | When true, website monitoring is paused. 20 | 21 | .PARAMETER CompanyId 22 | Used to associate website with company 23 | 24 | .PARAMETER DisableDNS 25 | When true, dns monitoring is paused. 26 | 27 | .PARAMETER DisableSSL 28 | When true, ssl cert monitoring is paused. 29 | 30 | .PARAMETER DisableWhois 31 | When true, whois monitoring is paused. 32 | 33 | .PARAMETER Slug 34 | Url identifier 35 | 36 | .EXAMPLE 37 | Set-HuduWebsite -Id 1 -Paused $true 38 | 39 | #> 40 | [CmdletBinding(SupportsShouldProcess)] 41 | Param ( 42 | [Parameter(Mandatory = $true)] 43 | [Int]$Id, 44 | 45 | [Parameter(Mandatory = $true)] 46 | [String]$Name, 47 | 48 | [String]$Notes = '', 49 | 50 | [String]$Paused = '', 51 | 52 | [Alias('company_id')] 53 | [Parameter(Mandatory = $true)] 54 | [Int]$CompanyId, 55 | 56 | [Alias('disable_dns')] 57 | [String]$DisableDNS = '', 58 | 59 | [Alias('disable_ssl')] 60 | [String]$DisableSSL = '', 61 | 62 | [Alias('disable_whois')] 63 | [String]$DisableWhois = '', 64 | 65 | [string]$Slug 66 | ) 67 | 68 | $Website = [ordered]@{website = [ordered]@{} } 69 | 70 | $Website.website.add('name', $Name) 71 | 72 | if ($Notes) { 73 | $Website.website.add('notes', $Notes) 74 | } 75 | 76 | if ($Paused) { 77 | $Website.website.add('paused', $Paused) 78 | } 79 | 80 | $Website.website.add('company_id', $companyid) 81 | 82 | if ($DisableDNS) { 83 | $Website.website.add('disable_dns', $DisableDNS) 84 | } 85 | 86 | if ($DisableSSL) { 87 | $Website.website.add('disable_ssl', $DisableSSL) 88 | } 89 | 90 | if ($DisableWhois) { 91 | $Website.website.add('disable_whois', $DisableWhois) 92 | } 93 | 94 | if ($Slug) { 95 | $Website.website.add('slug', $Slug) 96 | } 97 | 98 | $JSON = $Website | ConvertTo-Json 99 | 100 | if ($PSCmdlet.ShouldProcess($Id)) { 101 | Invoke-HuduRequest -Method put -Resource "/api/v1/websites/$Id" -Body $JSON 102 | } 103 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Tools/Update-Documentation.ps1: -------------------------------------------------------------------------------- 1 | Build-Module 2 | Remove-Module HuduAPI 3 | Import-Module .\Output\HuduAPI\HuduAPI.psd1 4 | New-MarkdownHelp -Module HuduAPI -OutputFolder .\Docs\ -Force -------------------------------------------------------------------------------- /build.psd1: -------------------------------------------------------------------------------- 1 | # Use this file to override the default parameter values used by the `Build-Module` 2 | # command when building the module (see `Get-Help Build-Module -Full` for details). 3 | @{ 4 | ModuleManifest = 'HuduAPI\HuduAPI.psd1' 5 | # Subsequent relative paths are to the ModuleManifest 6 | OutputDirectory = '..\Output\' 7 | VersionedOutputDirectory = $false 8 | CopyDirectories = @() 9 | } --------------------------------------------------------------------------------