diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dbd115..c722018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: $ProgressPreference = 'SilentlyContinue' $ErrorActionPreference = 'Stop' Install-Module -Name PSScriptAnalyzer -SkipPublisherCheck -Scope CurrentUser -MinimumVersion 1.19.1 -Force -Verbose - Invoke-ScriptAnalyzer -Path $env:GITHUB_WORKSPACE -Recurse -Settings (Join-Path -Path $env:GITHUB_WORKSPACE/Linters -ChildPath 'PSScriptAnalyzer.psd1') -ReportSummary -EnableExit + Invoke-ScriptAnalyzer -Path $env:GITHUB_WORKSPACE -Recurse -Settings (Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Linters\PSScriptAnalyzer.psd1') -ReportSummary -EnableExit # Run tests - name: Run tests (via Pester) shell: pwsh @@ -46,4 +46,4 @@ jobs: $ProgressPreference = 'SilentlyContinue' $ErrorActionPreference = 'Stop' Install-Module -Name platyPS, BuildHelpers -SkipPublisherCheck -Scope CurrentUser -Force - & $env:GITHUB_WORKSPACE/Build/New-Package.ps1 -Verbose + & (Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'Build\New-Package.ps1') -Verbose diff --git a/.github/workflows/publish_testing.yml b/.github/workflows/publish_testing.yml deleted file mode 100644 index b943a5c..0000000 --- a/.github/workflows/publish_testing.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: PublishTesting - -on: - workflow_dispatch: - -jobs: - publish: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - - name: Build package - shell: pwsh - run: | - $ProgressPreference='SilentlyContinue' - Install-Module platyPS,BuildHelpers -Force -SkipPublisherCheck -Scope CurrentUser - & $env:GITHUB_WORKSPACE/Build/New-Package.ps1 -Verbose - - - name: Publish to poshtestgallery.com - env: - NUGET_APIKEY_TESTING: ${{ secrets.NUGET_APIKEY_TESTING }} - shell: pwsh - run: | - $ProgressPreference='SilentlyContinue' - Register-PSRepository ` - -Name PSTestGallery ` - -SourceLocation https://www.poshtestgallery.com/api/v2 - Publish-Module ` - -Path $env:GITHUB_WORKSPACE/Build/Output/ ` - -NuGetApiKey $env:NUGET_APIKEY_TESTING ` - -Repository PSTestGallery ` - -Force diff --git a/Build/New-Package.ps1 b/Build/New-Package.ps1 index da19d4f..10fe295 100644 --- a/Build/New-Package.ps1 +++ b/Build/New-Package.ps1 @@ -1,74 +1,54 @@ -#requires -Modules platyPS, BuildHelpers +#requires -Modules BuildHelpers, platyPS param( [Parameter()] - [string] - $BuildOutputPath = "$(Resolve-Path "$PSScriptRoot/..")/Build/Output" + [string]$Build_OutputPath = "$(Resolve-Path "$PSScriptRoot\..")\Build\Output" ) -$repoPath = Resolve-Path "$PSScriptRoot/.." +$Repo_RootPath = Resolve-Path -Path "$PSScriptRoot\.." +$Repo_CmdletPath = Resolve-Path -Path "$PSScriptRoot\..\Cmdlets" -if (Test-Path $BuildOutputPath) { - Write-Verbose 'Removing existing build output directory' - Remove-Item $BuildOutputPath -Recurse -ErrorAction SilentlyContinue +if (Test-Path -Path $Build_OutputPath) { + Write-Verbose 'Removing existing build output directory...' + Remove-Item -Path $Build_OutputPath -Recurse -ErrorAction SilentlyContinue } -Write-Verbose 'Creating build output directories.' -New-Item -Type Directory $BuildOutputPath | Out-Null +Write-Verbose 'Creating build output directories...' +New-Item -Type Directory $Build_OutputPath | Out-Null # Compile all functions into a single psm file -$targetFile = "$BuildOutputPath/TeamViewerPS.psm1" -Write-Verbose 'Compiling single-file TeamViewer module.' -$ModuleTypes = @(Get-ChildItem -Path "$repoPath/Docs/TeamViewerPS.Types.ps1") -$PrivateFunctions = @(Get-ChildItem ` - -Path "$repoPath/Docs/Cmdlets/Private/*.ps1" ` - -ErrorAction SilentlyContinue) +$Build_ModulePath = (Join-Path -Path $Repo_CmdletPath -ChildPath 'TeamViewerPS.psm1') + +Write-Verbose 'Compiling single-file TeamViewer module...' +$ModuleTypes = @(Get-ChildItem -Path (Join-Path -Path $Repo_CmdletPath -ChildPath 'TeamViewerPS.Types.ps1')) + +$PrivateFunctions = @(Get-ChildItem -Path (Join-Path -Path $Repo_CmdletPath -ChildPath 'Private\*.ps1') -ErrorAction SilentlyContinue) Write-Verbose "Found $($PrivateFunctions.Count) private function files." -$PublicFunctions = @(Get-ChildItem ` - -Path "$repoPath/Docs/Cmdlets/Public/*.ps1" ` - -ErrorAction SilentlyContinue) + +$PublicFunctions = @(Get-ChildItem -Path (Join-Path -Path $Repo_CmdletPath -ChildPath 'Public\*.ps1') -ErrorAction SilentlyContinue) Write-Verbose "Found $($PublicFunctions.Count) public function files." -@($ModuleTypes + $PrivateFunctions + $PublicFunctions) | ` - Get-Content -Raw | ` - ForEach-Object { $_; "`r`n" } | ` - Set-Content -Path $targetFile -Encoding UTF8 + +@($ModuleTypes + $PrivateFunctions + $PublicFunctions) | Get-Content -Raw | ForEach-Object { $_; "`r`n" } | Set-Content -Path $Build_ModulePath -Encoding UTF8 # Create help from markdown -Write-Verbose 'Building help from Markdown' -New-ExternalHelp ` - -Path "$repoPath/Docs" ` - -OutputPath "$BuildOutputPath/en-US" | ` - Out-Null -New-ExternalHelp ` - -Path "$repoPath/Docs/Cmdlets_help" ` - -OutputPath "$BuildOutputPath/en-US" | ` - Out-Null +Write-Verbose 'Building help from Markdown...' +New-ExternalHelp -Path (Join-Path -Path $Repo_RootPath -ChildPath 'Docs') -OutputPath (Join-Path -Path $Build_OutputPath -ChildPath 'en-US') | Out-Null +New-ExternalHelp -Path (Join-Path -Path $Repo_RootPath -ChildPath 'Docs\Help') -OutputPath (Join-Path -Path $Build_OutputPath -ChildPath 'en-US') | Out-Null # Create module manifest -Write-Verbose 'Creating module manifest' -Copy-Item ` - -Path "$repoPath/Docs/TeamViewerPS.psd1" ` - -Destination "$BuildOutputPath/" -Copy-Item ` - -Path "$repoPath/Docs/*.format.ps1xml" ` - -Destination "$BuildOutputPath/" -Update-Metadata ` - -Path "$BuildOutputPath/TeamViewerPS.psd1" ` - -PropertyName 'FunctionsToExport' ` - -Value $PublicFunctions.BaseName +Write-Verbose 'Creating module manifest...' +Copy-Item -Path (Join-Path -Path $Repo_CmdletPath -ChildPath 'TeamViewerPS.psd1') -Destination $Build_OutputPath +Copy-Item -Path (Join-Path -Path $Repo_CmdletPath -ChildPath '*.format.ps1xml') -Destination $Build_OutputPath + +Update-Metadata -Path (Join-Path -Path $Repo_CmdletPath -ChildPath 'TeamViewerPS.psd1') -PropertyName 'FunctionsToExport' -Value $PublicFunctions.BaseName # Copy additional package files -Write-Verbose 'Copying additional files into the package' -Copy-Item ` - -Path ` - "$repoPath/LICENSE.md", ` - "$repoPath/CHANGELOG.md", ` - "$repoPath/README.md"` - -Destination "$BuildOutputPath/" +Write-Verbose 'Copying additional files into the package...' +Copy-Item -Path (Join-Path -Path $Repo_RootPath -ChildPath 'CHANGELOG.md') -Destination "$Build_OutputPath" +Copy-Item -Path (Join-Path -Path $Repo_RootPath -ChildPath 'LICENSE.md') -Destination "$Build_OutputPath" +Copy-Item -Path (Join-Path -Path $Repo_RootPath -ChildPath 'README.md') -Destination "$Build_OutputPath" Write-Verbose 'Listing package files:' -Push-Location $BuildOutputPath -Get-ChildItem -Recurse "$BuildOutputPath/" | ` - Sort-Object -Property FullName | ` - Resolve-Path -Relative +Push-Location -Path $Build_OutputPath +Get-ChildItem -Path "$Build_OutputPath\" -Recurse | Sort-Object -Property FullName | Resolve-Path -Relative Pop-Location diff --git a/CHANGELOG.md b/CHANGELOG.md index 5831d60..4288e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,24 +4,24 @@ ### Added - -Added 'Set-TeamViewerApiURi' to use TeamViewer test API. - -Added user role commands to remotely manage user roles of a TeamViewer company. - -Added `Add-TeamViewerAssignment` and `Remove-TeamViewerAssignment` commands to assign and unassign a device from a TeamViewer company. - -Added `Add-TeamViewerCustomization` and `Remove-TeamViewerCustomization` commands to apply and remove customization. - -Added `Export-TeamViewerSystemInformation` to create zip file for support. - -Added `Set-TeamViewerPSProxy` and `Remove-TeamViewerPSProxy` to set proxy to access WebAPI. - -Added `Get-TeamViewerInstallationDirectory` to return installation directory. - -Added `Remove-TeamViewerPolicyFromManagedDevice` to remove policies from managed devices. +- Added 'Set-TeamViewerApiURi' to use TeamViewer test API. +- Added commands to remotely manage user roles of a TeamViewer company. +- Added `Add-TeamViewerAssignment` and `Remove-TeamViewerAssignment` commands to assign and unassign a device from a TeamViewer company. +- Added `Add-TeamViewerCustomization` and `Remove-TeamViewerCustomization` commands to apply and remove customization. +- Added `Export-TeamViewerSystemInformation` to create zip file for support. +- Added `Set-TeamViewerPSProxy` and `Remove-TeamViewerPSProxy` to set proxy to access WebAPI. +- Added `Get-TeamViewerInstallationDirectory` to return installation directory. +- Added `Remove-TeamViewerPolicyFromManagedDevice` to remove policies from managed devices. ### Changed - -Extended `Invoke-TeamViewerPackageDownload` with MSI package type. - -Folder structure modified. - -`-RemovePolicy` switch removed from `Set-TeamViewerManagedDevice`. +- Extended `Invoke-TeamViewerPackageDownload` with MSI package type. +- `-RemovePolicy` switch removed from `Set-TeamViewerManagedDevice`. +- Optimized folder structure. ### Fixed - -Fixed `Get-TeamViewerLinuxGlobalConfig` to handle null values. +- Fixed `Get-TeamViewerLinuxGlobalConfig` to handle null values. ## 1.5.2 (2023-09-18) @@ -37,7 +37,7 @@ ### Added - Added `Remove-TeamViewerUser` cmdlet to remove user from TeamViewer company. (Thanks @OtterKring) -- Added `Remove-TeamViewerManagedDeviceManagement` to unmanage a device. +- Added `Remove-TeamViewerManagedDeviceManagement` to un-manage a device. ### Changed diff --git a/docs/Cmdlets/Private/Add-Registry.ps1 b/Cmdlets/Private/Add-Registry.ps1 similarity index 100% rename from docs/Cmdlets/Private/Add-Registry.ps1 rename to Cmdlets/Private/Add-Registry.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-DateTime.ps1 b/Cmdlets/Private/ConvertTo-DateTime.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-DateTime.ps1 rename to Cmdlets/Private/ConvertTo-DateTime.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-ErrorRecord.ps1 b/Cmdlets/Private/ConvertTo-ErrorRecord.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-ErrorRecord.ps1 rename to Cmdlets/Private/ConvertTo-ErrorRecord.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerAccount.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerAccount.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerAccount.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerAccount.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerAuditEvent.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerAuditEvent.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerAuditEvent.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerAuditEvent.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerConnectionReport.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerConnectionReport.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerConnectionReport.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerConnectionReport.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerContact.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerContact.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerContact.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerContact.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerDevice.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerDevice.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerDevice.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerDevice.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerGroup.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerGroup.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerGroupShare.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerGroupShare.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerGroupShare.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerGroupShare.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerManagedDevice.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerManagedDevice.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerManagedDevice.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerManagedGroup.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerManagedGroup.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerManagedGroup.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerManagedGroup.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerManager.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerManager.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerManager.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerManager.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerPolicy.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerPolicy.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerPolicy.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerPolicy.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerRestError.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerRestError.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerRestError.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerRestError.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUser.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUser.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUser.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUser.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUserGroup.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUserGroup.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerRoleAssignedUserGroup.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerSsoDomain.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerSsoDomain.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerSsoDomain.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerSsoDomain.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerUser.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerUser.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerUser.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerUser.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerUserGroup.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerUserGroup.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerUserGroup.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerUserGroupMember.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerUserGroupMember.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerUserGroupMember.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerUserGroupMember.ps1 diff --git a/docs/Cmdlets/Private/ConvertTo-TeamViewerUserRole.ps1 b/Cmdlets/Private/ConvertTo-TeamViewerUserRole.ps1 similarity index 100% rename from docs/Cmdlets/Private/ConvertTo-TeamViewerUserRole.ps1 rename to Cmdlets/Private/ConvertTo-TeamViewerUserRole.ps1 diff --git a/docs/Cmdlets/Private/Get-ClientId.ps1 b/Cmdlets/Private/Get-ClientId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-ClientId.ps1 rename to Cmdlets/Private/Get-ClientId.ps1 diff --git a/docs/Cmdlets/Private/Get-HostFile.ps1 b/Cmdlets/Private/Get-HostFile.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-HostFile.ps1 rename to Cmdlets/Private/Get-HostFile.ps1 diff --git a/docs/Cmdlets/Private/Get-InstalledSoftware.ps1 b/Cmdlets/Private/Get-InstalledSoftware.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-InstalledSoftware.ps1 rename to Cmdlets/Private/Get-InstalledSoftware.ps1 diff --git a/docs/Cmdlets/Private/Get-IpConfig.ps1 b/Cmdlets/Private/Get-IpConfig.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-IpConfig.ps1 rename to Cmdlets/Private/Get-IpConfig.ps1 diff --git a/docs/Cmdlets/Private/Get-MSInfo32.ps1 b/Cmdlets/Private/Get-MSInfo32.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-MSInfo32.ps1 rename to Cmdlets/Private/Get-MSInfo32.ps1 diff --git a/docs/Cmdlets/Private/Get-NSLookUpData.ps1 b/Cmdlets/Private/Get-NSLookUpData.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-NSLookUpData.ps1 rename to Cmdlets/Private/Get-NSLookUpData.ps1 diff --git a/docs/Cmdlets/Private/Get-OperatingSystem.ps1 b/Cmdlets/Private/Get-OperatingSystem.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-OperatingSystem.ps1 rename to Cmdlets/Private/Get-OperatingSystem.ps1 diff --git a/docs/Cmdlets/Private/Get-RegistryPath.ps1 b/Cmdlets/Private/Get-RegistryPath.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-RegistryPath.ps1 rename to Cmdlets/Private/Get-RegistryPath.ps1 diff --git a/docs/Cmdlets/Private/Get-RouteTable.ps1 b/Cmdlets/Private/Get-RouteTable.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-RouteTable.ps1 rename to Cmdlets/Private/Get-RouteTable.ps1 diff --git a/docs/Cmdlets/Private/Get-TSCDirectoryFile.ps1 b/Cmdlets/Private/Get-TSCDirectoryFile.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TSCDirectoryFile.ps1 rename to Cmdlets/Private/Get-TSCDirectoryFile.ps1 diff --git a/docs/Cmdlets/Private/Get-TSCSearchDirectory.ps1 b/Cmdlets/Private/Get-TSCSearchDirectory.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TSCSearchDirectory.ps1 rename to Cmdlets/Private/Get-TSCSearchDirectory.ps1 diff --git a/docs/Cmdlets/Private/Get-TeamViewerApiUri.ps1 b/Cmdlets/Private/Get-TeamViewerApiUri.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TeamViewerApiUri.ps1 rename to Cmdlets/Private/Get-TeamViewerApiUri.ps1 diff --git a/docs/Cmdlets/Private/Get-TeamViewerLinuxGlobalConfig.ps1 b/Cmdlets/Private/Get-TeamViewerLinuxGlobalConfig.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TeamViewerLinuxGlobalConfig.ps1 rename to Cmdlets/Private/Get-TeamViewerLinuxGlobalConfig.ps1 diff --git a/docs/Cmdlets/Private/Get-TeamViewerRegKeyPath.ps1 b/Cmdlets/Private/Get-TeamViewerRegKeyPath.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TeamViewerRegKeyPath.ps1 rename to Cmdlets/Private/Get-TeamViewerRegKeyPath.ps1 diff --git a/docs/Cmdlets/Private/Get-TeamViewerServiceName.ps1 b/Cmdlets/Private/Get-TeamViewerServiceName.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TeamViewerServiceName.ps1 rename to Cmdlets/Private/Get-TeamViewerServiceName.ps1 diff --git a/docs/Cmdlets/Private/Get-TypeAndValueOfRegistryValue.ps1 b/Cmdlets/Private/Get-TypeAndValueOfRegistryValue.ps1 similarity index 100% rename from docs/Cmdlets/Private/Get-TypeAndValueOfRegistryValue.ps1 rename to Cmdlets/Private/Get-TypeAndValueOfRegistryValue.ps1 diff --git a/docs/Cmdlets/Private/Invoke-ExternalCommand.ps1 b/Cmdlets/Private/Invoke-ExternalCommand.ps1 similarity index 100% rename from docs/Cmdlets/Private/Invoke-ExternalCommand.ps1 rename to Cmdlets/Private/Invoke-ExternalCommand.ps1 diff --git a/docs/Cmdlets/Private/Invoke-TeamViewerRestMethod.ps1 b/Cmdlets/Private/Invoke-TeamViewerRestMethod.ps1 similarity index 100% rename from docs/Cmdlets/Private/Invoke-TeamViewerRestMethod.ps1 rename to Cmdlets/Private/Invoke-TeamViewerRestMethod.ps1 diff --git a/docs/Cmdlets/Private/Resolve-AssignmentErrorCode.ps1 b/Cmdlets/Private/Resolve-AssignmentErrorCode.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-AssignmentErrorCode.ps1 rename to Cmdlets/Private/Resolve-AssignmentErrorCode.ps1 diff --git a/docs/Cmdlets/Private/Resolve-CustomizationErrorCode.ps1 b/Cmdlets/Private/Resolve-CustomizationErrorCode.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-CustomizationErrorCode.ps1 rename to Cmdlets/Private/Resolve-CustomizationErrorCode.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerContactId.ps1 b/Cmdlets/Private/Resolve-TeamViewerContactId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerContactId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerContactId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerDeviceId.ps1 b/Cmdlets/Private/Resolve-TeamViewerDeviceId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerDeviceId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerDeviceId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerGroupId.ps1 b/Cmdlets/Private/Resolve-TeamViewerGroupId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerGroupId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerGroupId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerLanguage.ps1 b/Cmdlets/Private/Resolve-TeamViewerLanguage.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerLanguage.ps1 rename to Cmdlets/Private/Resolve-TeamViewerLanguage.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerManagedDeviceId.ps1 b/Cmdlets/Private/Resolve-TeamViewerManagedDeviceId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerManagedDeviceId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerManagedDeviceId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerManagedGroupId.ps1 b/Cmdlets/Private/Resolve-TeamViewerManagedGroupId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerManagedGroupId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerManagedGroupId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerManagerId.ps1 b/Cmdlets/Private/Resolve-TeamViewerManagerId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerManagerId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerManagerId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerPolicyId.ps1 b/Cmdlets/Private/Resolve-TeamViewerPolicyId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerPolicyId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerPolicyId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerSsoDomainId.ps1 b/Cmdlets/Private/Resolve-TeamViewerSsoDomainId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerSsoDomainId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerSsoDomainId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerUserEmail.ps1 b/Cmdlets/Private/Resolve-TeamViewerUserEmail.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerUserEmail.ps1 rename to Cmdlets/Private/Resolve-TeamViewerUserEmail.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerUserGroupId.ps1 b/Cmdlets/Private/Resolve-TeamViewerUserGroupId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerUserGroupId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerUserGroupId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerUserGroupMemberId.ps1 b/Cmdlets/Private/Resolve-TeamViewerUserGroupMemberId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerUserGroupMemberId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerUserGroupMemberId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerUserId.ps1 b/Cmdlets/Private/Resolve-TeamViewerUserId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerUserId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerUserId.ps1 diff --git a/docs/Cmdlets/Private/Resolve-TeamViewerUserRoleId.ps1 b/Cmdlets/Private/Resolve-TeamViewerUserRoleId.ps1 similarity index 100% rename from docs/Cmdlets/Private/Resolve-TeamViewerUserRoleId.ps1 rename to Cmdlets/Private/Resolve-TeamViewerUserRoleId.ps1 diff --git a/docs/Cmdlets/Private/Test-TcpConnection.ps1 b/Cmdlets/Private/Test-TcpConnection.ps1 similarity index 100% rename from docs/Cmdlets/Private/Test-TcpConnection.ps1 rename to Cmdlets/Private/Test-TcpConnection.ps1 diff --git a/docs/Cmdlets/Private/Test-TeamViewer32on64.ps1 b/Cmdlets/Private/Test-TeamViewer32on64.ps1 similarity index 100% rename from docs/Cmdlets/Private/Test-TeamViewer32on64.ps1 rename to Cmdlets/Private/Test-TeamViewer32on64.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerAssignment.ps1 b/Cmdlets/Public/Add-TeamViewerAssignment.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerAssignment.ps1 rename to Cmdlets/Public/Add-TeamViewerAssignment.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerCustomization.ps1 b/Cmdlets/Public/Add-TeamViewerCustomization.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerCustomization.ps1 rename to Cmdlets/Public/Add-TeamViewerCustomization.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerManagedDevice.ps1 b/Cmdlets/Public/Add-TeamViewerManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerManagedDevice.ps1 rename to Cmdlets/Public/Add-TeamViewerManagedDevice.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerManager.ps1 b/Cmdlets/Public/Add-TeamViewerManager.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerManager.ps1 rename to Cmdlets/Public/Add-TeamViewerManager.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerRoleToAccount.ps1 b/Cmdlets/Public/Add-TeamViewerRoleToAccount.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerRoleToAccount.ps1 rename to Cmdlets/Public/Add-TeamViewerRoleToAccount.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1 b/Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1 rename to Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerSsoExclusion.ps1 b/Cmdlets/Public/Add-TeamViewerSsoExclusion.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerSsoExclusion.ps1 rename to Cmdlets/Public/Add-TeamViewerSsoExclusion.ps1 diff --git a/docs/Cmdlets/Public/Add-TeamViewerUserGroupMember.ps1 b/Cmdlets/Public/Add-TeamViewerUserGroupMember.ps1 similarity index 100% rename from docs/Cmdlets/Public/Add-TeamViewerUserGroupMember.ps1 rename to Cmdlets/Public/Add-TeamViewerUserGroupMember.ps1 diff --git a/docs/Cmdlets/Public/Connect-TeamViewerApi.ps1 b/Cmdlets/Public/Connect-TeamViewerApi.ps1 similarity index 100% rename from docs/Cmdlets/Public/Connect-TeamViewerApi.ps1 rename to Cmdlets/Public/Connect-TeamViewerApi.ps1 diff --git a/docs/Cmdlets/Public/Disconnect-TeamViewerApi.ps1 b/Cmdlets/Public/Disconnect-TeamViewerApi.ps1 similarity index 100% rename from docs/Cmdlets/Public/Disconnect-TeamViewerApi.ps1 rename to Cmdlets/Public/Disconnect-TeamViewerApi.ps1 diff --git a/docs/Cmdlets/Public/Export-TeamViewerSystemInformation.ps1 b/Cmdlets/Public/Export-TeamViewerSystemInformation.ps1 similarity index 100% rename from docs/Cmdlets/Public/Export-TeamViewerSystemInformation.ps1 rename to Cmdlets/Public/Export-TeamViewerSystemInformation.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerAccount.ps1 b/Cmdlets/Public/Get-TeamViewerAccount.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerAccount.ps1 rename to Cmdlets/Public/Get-TeamViewerAccount.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerConnectionReport.ps1 b/Cmdlets/Public/Get-TeamViewerConnectionReport.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerConnectionReport.ps1 rename to Cmdlets/Public/Get-TeamViewerConnectionReport.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerContact.ps1 b/Cmdlets/Public/Get-TeamViewerContact.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerContact.ps1 rename to Cmdlets/Public/Get-TeamViewerContact.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerCustomModuleId.ps1 b/Cmdlets/Public/Get-TeamViewerCustomModuleId.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerCustomModuleId.ps1 rename to Cmdlets/Public/Get-TeamViewerCustomModuleId.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerDevice.ps1 b/Cmdlets/Public/Get-TeamViewerDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerDevice.ps1 rename to Cmdlets/Public/Get-TeamViewerDevice.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerEventLog.ps1 b/Cmdlets/Public/Get-TeamViewerEventLog.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerEventLog.ps1 rename to Cmdlets/Public/Get-TeamViewerEventLog.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerGroup.ps1 b/Cmdlets/Public/Get-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerGroup.ps1 rename to Cmdlets/Public/Get-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerId.ps1 b/Cmdlets/Public/Get-TeamViewerId.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerId.ps1 rename to Cmdlets/Public/Get-TeamViewerId.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1 b/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1 rename to Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerLogFilePath.ps1 b/Cmdlets/Public/Get-TeamViewerLogFilePath.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerLogFilePath.ps1 rename to Cmdlets/Public/Get-TeamViewerLogFilePath.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerManagedDevice.ps1 b/Cmdlets/Public/Get-TeamViewerManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerManagedDevice.ps1 rename to Cmdlets/Public/Get-TeamViewerManagedDevice.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerManagedGroup.ps1 b/Cmdlets/Public/Get-TeamViewerManagedGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerManagedGroup.ps1 rename to Cmdlets/Public/Get-TeamViewerManagedGroup.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerManagementId.ps1 b/Cmdlets/Public/Get-TeamViewerManagementId.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerManagementId.ps1 rename to Cmdlets/Public/Get-TeamViewerManagementId.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerManager.ps1 b/Cmdlets/Public/Get-TeamViewerManager.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerManager.ps1 rename to Cmdlets/Public/Get-TeamViewerManager.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerPolicy.ps1 b/Cmdlets/Public/Get-TeamViewerPolicy.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerPolicy.ps1 rename to Cmdlets/Public/Get-TeamViewerPolicy.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToAccount.ps1 b/Cmdlets/Public/Get-TeamViewerRoleAssignmentToAccount.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToAccount.ps1 rename to Cmdlets/Public/Get-TeamViewerRoleAssignmentToAccount.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToUserGroup.ps1 b/Cmdlets/Public/Get-TeamViewerRoleAssignmentToUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToUserGroup.ps1 rename to Cmdlets/Public/Get-TeamViewerRoleAssignmentToUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerService.ps1 b/Cmdlets/Public/Get-TeamViewerService.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerService.ps1 rename to Cmdlets/Public/Get-TeamViewerService.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerSsoDomain.ps1 b/Cmdlets/Public/Get-TeamViewerSsoDomain.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerSsoDomain.ps1 rename to Cmdlets/Public/Get-TeamViewerSsoDomain.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerSsoExclusion.ps1 b/Cmdlets/Public/Get-TeamViewerSsoExclusion.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerSsoExclusion.ps1 rename to Cmdlets/Public/Get-TeamViewerSsoExclusion.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerUser.ps1 b/Cmdlets/Public/Get-TeamViewerUser.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerUser.ps1 rename to Cmdlets/Public/Get-TeamViewerUser.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerUserGroup.ps1 b/Cmdlets/Public/Get-TeamViewerUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerUserGroup.ps1 rename to Cmdlets/Public/Get-TeamViewerUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerUserGroupMember.ps1 b/Cmdlets/Public/Get-TeamViewerUserGroupMember.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerUserGroupMember.ps1 rename to Cmdlets/Public/Get-TeamViewerUserGroupMember.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerUserRole.ps1 b/Cmdlets/Public/Get-TeamViewerUserRole.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerUserRole.ps1 rename to Cmdlets/Public/Get-TeamViewerUserRole.ps1 diff --git a/docs/Cmdlets/Public/Get-TeamViewerVersion.ps1 b/Cmdlets/Public/Get-TeamViewerVersion.ps1 similarity index 100% rename from docs/Cmdlets/Public/Get-TeamViewerVersion.ps1 rename to Cmdlets/Public/Get-TeamViewerVersion.ps1 diff --git a/docs/Cmdlets/Public/Invoke-TeamViewerPackageDownload.ps1 b/Cmdlets/Public/Invoke-TeamViewerPackageDownload.ps1 similarity index 100% rename from docs/Cmdlets/Public/Invoke-TeamViewerPackageDownload.ps1 rename to Cmdlets/Public/Invoke-TeamViewerPackageDownload.ps1 diff --git a/docs/Cmdlets/Public/Invoke-TeamViewerPing.ps1 b/Cmdlets/Public/Invoke-TeamViewerPing.ps1 similarity index 100% rename from docs/Cmdlets/Public/Invoke-TeamViewerPing.ps1 rename to Cmdlets/Public/Invoke-TeamViewerPing.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerContact.ps1 b/Cmdlets/Public/New-TeamViewerContact.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerContact.ps1 rename to Cmdlets/Public/New-TeamViewerContact.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerDevice.ps1 b/Cmdlets/Public/New-TeamViewerDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerDevice.ps1 rename to Cmdlets/Public/New-TeamViewerDevice.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerGroup.ps1 b/Cmdlets/Public/New-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerGroup.ps1 rename to Cmdlets/Public/New-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerManagedGroup.ps1 b/Cmdlets/Public/New-TeamViewerManagedGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerManagedGroup.ps1 rename to Cmdlets/Public/New-TeamViewerManagedGroup.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerPolicy.ps1 b/Cmdlets/Public/New-TeamViewerPolicy.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerPolicy.ps1 rename to Cmdlets/Public/New-TeamViewerPolicy.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerUser.ps1 b/Cmdlets/Public/New-TeamViewerUser.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerUser.ps1 rename to Cmdlets/Public/New-TeamViewerUser.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerUserGroup.ps1 b/Cmdlets/Public/New-TeamViewerUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerUserGroup.ps1 rename to Cmdlets/Public/New-TeamViewerUserGroup.ps1 diff --git a/docs/Cmdlets/Public/New-TeamViewerUserRole.ps1 b/Cmdlets/Public/New-TeamViewerUserRole.ps1 similarity index 100% rename from docs/Cmdlets/Public/New-TeamViewerUserRole.ps1 rename to Cmdlets/Public/New-TeamViewerUserRole.ps1 diff --git a/docs/Cmdlets/Public/Publish-TeamViewerGroup.ps1 b/Cmdlets/Public/Publish-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Publish-TeamViewerGroup.ps1 rename to Cmdlets/Public/Publish-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerAssignment.ps1 b/Cmdlets/Public/Remove-TeamViewerAssignment.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerAssignment.ps1 rename to Cmdlets/Public/Remove-TeamViewerAssignment.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerContact.ps1 b/Cmdlets/Public/Remove-TeamViewerContact.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerContact.ps1 rename to Cmdlets/Public/Remove-TeamViewerContact.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerCustomization.ps1 b/Cmdlets/Public/Remove-TeamViewerCustomization.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerCustomization.ps1 rename to Cmdlets/Public/Remove-TeamViewerCustomization.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerDevice.ps1 b/Cmdlets/Public/Remove-TeamViewerDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerDevice.ps1 rename to Cmdlets/Public/Remove-TeamViewerDevice.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerGroup.ps1 b/Cmdlets/Public/Remove-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerGroup.ps1 rename to Cmdlets/Public/Remove-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerManagedDevice.ps1 b/Cmdlets/Public/Remove-TeamViewerManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerManagedDevice.ps1 rename to Cmdlets/Public/Remove-TeamViewerManagedDevice.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerManagedDeviceManagement.ps1 b/Cmdlets/Public/Remove-TeamViewerManagedDeviceManagement.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerManagedDeviceManagement.ps1 rename to Cmdlets/Public/Remove-TeamViewerManagedDeviceManagement.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerManagedGroup.ps1 b/Cmdlets/Public/Remove-TeamViewerManagedGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerManagedGroup.ps1 rename to Cmdlets/Public/Remove-TeamViewerManagedGroup.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerManager.ps1 b/Cmdlets/Public/Remove-TeamViewerManager.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerManager.ps1 rename to Cmdlets/Public/Remove-TeamViewerManager.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1 b/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1 rename to Cmdlets/Public/Remove-TeamViewerPSProxy.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerPolicy.ps1 b/Cmdlets/Public/Remove-TeamViewerPolicy.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerPolicy.ps1 rename to Cmdlets/Public/Remove-TeamViewerPolicy.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerPolicyFromManagedDevice.ps1 b/Cmdlets/Public/Remove-TeamViewerPolicyFromManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerPolicyFromManagedDevice.ps1 rename to Cmdlets/Public/Remove-TeamViewerPolicyFromManagedDevice.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerRoleFromAccount.ps1 b/Cmdlets/Public/Remove-TeamViewerRoleFromAccount.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerRoleFromAccount.ps1 rename to Cmdlets/Public/Remove-TeamViewerRoleFromAccount.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerRoleFromUserGroup.ps1 b/Cmdlets/Public/Remove-TeamViewerRoleFromUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerRoleFromUserGroup.ps1 rename to Cmdlets/Public/Remove-TeamViewerRoleFromUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerSsoExclusion.ps1 b/Cmdlets/Public/Remove-TeamViewerSsoExclusion.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerSsoExclusion.ps1 rename to Cmdlets/Public/Remove-TeamViewerSsoExclusion.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerUser.ps1 b/Cmdlets/Public/Remove-TeamViewerUser.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerUser.ps1 rename to Cmdlets/Public/Remove-TeamViewerUser.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerUserGroup.ps1 b/Cmdlets/Public/Remove-TeamViewerUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerUserGroup.ps1 rename to Cmdlets/Public/Remove-TeamViewerUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerUserGroupMember.ps1 b/Cmdlets/Public/Remove-TeamViewerUserGroupMember.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerUserGroupMember.ps1 rename to Cmdlets/Public/Remove-TeamViewerUserGroupMember.ps1 diff --git a/docs/Cmdlets/Public/Remove-TeamViewerUserRole.ps1 b/Cmdlets/Public/Remove-TeamViewerUserRole.ps1 similarity index 100% rename from docs/Cmdlets/Public/Remove-TeamViewerUserRole.ps1 rename to Cmdlets/Public/Remove-TeamViewerUserRole.ps1 diff --git a/docs/Cmdlets/Public/Restart-TeamViewerService.ps1 b/Cmdlets/Public/Restart-TeamViewerService.ps1 similarity index 100% rename from docs/Cmdlets/Public/Restart-TeamViewerService.ps1 rename to Cmdlets/Public/Restart-TeamViewerService.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerAPIUri.ps1 b/Cmdlets/Public/Set-TeamViewerAPIUri.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerAPIUri.ps1 rename to Cmdlets/Public/Set-TeamViewerAPIUri.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerAccount.ps1 b/Cmdlets/Public/Set-TeamViewerAccount.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerAccount.ps1 rename to Cmdlets/Public/Set-TeamViewerAccount.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerDevice.ps1 b/Cmdlets/Public/Set-TeamViewerDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerDevice.ps1 rename to Cmdlets/Public/Set-TeamViewerDevice.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerGroup.ps1 b/Cmdlets/Public/Set-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerGroup.ps1 rename to Cmdlets/Public/Set-TeamViewerGroup.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerManagedDevice.ps1 b/Cmdlets/Public/Set-TeamViewerManagedDevice.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerManagedDevice.ps1 rename to Cmdlets/Public/Set-TeamViewerManagedDevice.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerManagedGroup.ps1 b/Cmdlets/Public/Set-TeamViewerManagedGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerManagedGroup.ps1 rename to Cmdlets/Public/Set-TeamViewerManagedGroup.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerManager.ps1 b/Cmdlets/Public/Set-TeamViewerManager.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerManager.ps1 rename to Cmdlets/Public/Set-TeamViewerManager.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerPSProxy.ps1 b/Cmdlets/Public/Set-TeamViewerPSProxy.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerPSProxy.ps1 rename to Cmdlets/Public/Set-TeamViewerPSProxy.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerPolicy.ps1 b/Cmdlets/Public/Set-TeamViewerPolicy.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerPolicy.ps1 rename to Cmdlets/Public/Set-TeamViewerPolicy.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerUser.ps1 b/Cmdlets/Public/Set-TeamViewerUser.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerUser.ps1 rename to Cmdlets/Public/Set-TeamViewerUser.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerUserGroup.ps1 b/Cmdlets/Public/Set-TeamViewerUserGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerUserGroup.ps1 rename to Cmdlets/Public/Set-TeamViewerUserGroup.ps1 diff --git a/docs/Cmdlets/Public/Set-TeamViewerUserRole.ps1 b/Cmdlets/Public/Set-TeamViewerUserRole.ps1 similarity index 100% rename from docs/Cmdlets/Public/Set-TeamViewerUserRole.ps1 rename to Cmdlets/Public/Set-TeamViewerUserRole.ps1 diff --git a/docs/Cmdlets/Public/Start-TeamViewerService.ps1 b/Cmdlets/Public/Start-TeamViewerService.ps1 similarity index 100% rename from docs/Cmdlets/Public/Start-TeamViewerService.ps1 rename to Cmdlets/Public/Start-TeamViewerService.ps1 diff --git a/docs/Cmdlets/Public/Stop-TeamViewerService.ps1 b/Cmdlets/Public/Stop-TeamViewerService.ps1 similarity index 100% rename from docs/Cmdlets/Public/Stop-TeamViewerService.ps1 rename to Cmdlets/Public/Stop-TeamViewerService.ps1 diff --git a/docs/Cmdlets/Public/Test-TeamViewerConnectivity.ps1 b/Cmdlets/Public/Test-TeamViewerConnectivity.ps1 similarity index 100% rename from docs/Cmdlets/Public/Test-TeamViewerConnectivity.ps1 rename to Cmdlets/Public/Test-TeamViewerConnectivity.ps1 diff --git a/docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1 b/Cmdlets/Public/Test-TeamViewerInstallation.ps1 similarity index 100% rename from docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1 rename to Cmdlets/Public/Test-TeamViewerInstallation.ps1 diff --git a/docs/Cmdlets/Public/Unpublish-TeamViewerGroup.ps1 b/Cmdlets/Public/Unpublish-TeamViewerGroup.ps1 similarity index 100% rename from docs/Cmdlets/Public/Unpublish-TeamViewerGroup.ps1 rename to Cmdlets/Public/Unpublish-TeamViewerGroup.ps1 diff --git a/docs/TeamViewerPS.Types.ps1 b/Cmdlets/TeamViewerPS.Types.ps1 similarity index 100% rename from docs/TeamViewerPS.Types.ps1 rename to Cmdlets/TeamViewerPS.Types.ps1 diff --git a/docs/TeamViewerPS.format.ps1xml b/Cmdlets/TeamViewerPS.format.ps1xml similarity index 100% rename from docs/TeamViewerPS.format.ps1xml rename to Cmdlets/TeamViewerPS.format.ps1xml diff --git a/docs/TeamViewerPS.psd1 b/Cmdlets/TeamViewerPS.psd1 similarity index 61% rename from docs/TeamViewerPS.psd1 rename to Cmdlets/TeamViewerPS.psd1 index 0ffbf58..67b1bf3 100644 --- a/docs/TeamViewerPS.psd1 +++ b/Cmdlets/TeamViewerPS.psd1 @@ -1,4 +1,4 @@ -@{ +@{ # Script module or binary module file associated with this manifest. RootModule = 'TeamViewerPS.psm1' @@ -18,7 +18,7 @@ CompanyName = 'TeamViewer Germany GmbH' # Copyright statement for this module. - Copyright = '(c) 2021-2022 TeamViewer Germany GmbH. All rights reserved.' + Copyright = '(c) 2021-2023 TeamViewer Germany GmbH. All rights reserved.' # Description of the functionality provided by this module. Description = 'TeamViewerPS allows to interact with the TeamViewer Web API as well as a locally installed TeamViewer client.' @@ -60,7 +60,7 @@ # NestedModules = @() # Functions to export from this module. - FunctionsToExport = '*' + FunctionsToExport = @('Add-TeamViewerAssignment','Add-TeamViewerCustomization','Add-TeamViewerManagedDevice','Add-TeamViewerManager','Add-TeamViewerRoleToAccount','Add-TeamViewerRoleToUserGroup','Add-TeamViewerSsoExclusion','Add-TeamViewerUserGroupMember','Connect-TeamViewerApi','Disconnect-TeamViewerApi','Export-TeamViewerSystemInformation','Get-TeamViewerAccount','Get-TeamViewerConnectionReport','Get-TeamViewerContact','Get-TeamViewerCustomModuleId','Get-TeamViewerDevice','Get-TeamViewerEventLog','Get-TeamViewerGroup','Get-TeamViewerId','Get-TeamViewerInstallationDirectory','Get-TeamViewerLogFilePath','Get-TeamViewerManagedDevice','Get-TeamViewerManagedGroup','Get-TeamViewerManagementId','Get-TeamViewerManager','Get-TeamViewerPolicy','Get-TeamViewerRoleAssignmentToAccount','Get-TeamViewerRoleAssignmentToUserGroup','Get-TeamViewerService','Get-TeamViewerSsoDomain','Get-TeamViewerSsoExclusion','Get-TeamViewerUser','Get-TeamViewerUserGroup','Get-TeamViewerUserGroupMember','Get-TeamViewerUserRole','Get-TeamViewerVersion','Invoke-TeamViewerPackageDownload','Invoke-TeamViewerPing','New-TeamViewerContact','New-TeamViewerDevice','New-TeamViewerGroup','New-TeamViewerManagedGroup','New-TeamViewerPolicy','New-TeamViewerUser','New-TeamViewerUserGroup','New-TeamViewerUserRole','Publish-TeamViewerGroup','Remove-TeamViewerAssignment','Remove-TeamViewerContact','Remove-TeamViewerCustomization','Remove-TeamViewerDevice','Remove-TeamViewerGroup','Remove-TeamViewerManagedDevice','Remove-TeamViewerManagedDeviceManagement','Remove-TeamViewerManagedGroup','Remove-TeamViewerManager','Remove-TeamViewerPolicy','Remove-TeamViewerPolicyFromManagedDevice','Remove-TeamViewerPSProxy','Remove-TeamViewerRoleFromAccount','Remove-TeamViewerRoleFromUserGroup','Remove-TeamViewerSsoExclusion','Remove-TeamViewerUser','Remove-TeamViewerUserGroup','Remove-TeamViewerUserGroupMember','Remove-TeamViewerUserRole','Restart-TeamViewerService','Set-TeamViewerAccount','Set-TeamViewerAPIUri','Set-TeamViewerDevice','Set-TeamViewerGroup','Set-TeamViewerManagedDevice','Set-TeamViewerManagedGroup','Set-TeamViewerManager','Set-TeamViewerPolicy','Set-TeamViewerPSProxy','Set-TeamViewerUser','Set-TeamViewerUserGroup','Set-TeamViewerUserRole','Start-TeamViewerService','Stop-TeamViewerService','Test-TeamViewerConnectivity','Test-TeamViewerInstallation','Unpublish-TeamViewerGroup') # Cmdlets to export from this module. CmdletsToExport = @() diff --git a/Cmdlets/TeamViewerPS.psm1 b/Cmdlets/TeamViewerPS.psm1 new file mode 100644 index 0000000..8f8353d --- /dev/null +++ b/Cmdlets/TeamViewerPS.psm1 @@ -0,0 +1,5849 @@ +enum TeamViewerConnectionReportSessionType { + RemoteConnection = 1 + RemoteSupportActive = 2 + RemoteSupportActiveSdk = 3 +} + +enum PolicyType { + TeamViewer = 1 + Monitoring = 4 + PatchManagement = 5 +} + + + +function Add-Registry { + param ( + [Microsoft.Win32.RegistryKey]$RegKey, + [string]$Program + ) + + #CustomObject including all information for each registry and sub keys + $retRegKey = [PSCustomObject]@{ + Program = $Program + RegistryPath = $RegKey.Name + Entries = @() + } + Write-Output "Collecting registry data $($retRegKey.RegistryPath)" + foreach ($valueName in $RegKey.GetValueNames()) { + $value = $RegKey.GetValue($valueName) + $type, $value = Get-TypeAndValueOfRegistryValue -RegKey $RegKey -ValueName $valueName + $blackList = @('BuddyLoginTokenAES', 'BuddyLoginTokenSecretAES', 'Certificate', 'CertificateKey', 'CertificateKeyProtected', + 'MultiPwdMgmtPwdData', 'PermanentPassword', 'PK', 'SecurityPasswordAES', 'SK', 'SRPPasswordMachineIdentifier') + foreach ($blackListValue in $blackList) { + if ($valueName -eq $blackListValue) { + $value = '___PRIVATE___' + } + } + $entry = [PSCustomObject]@{ + Name = $valueName + Value = $value + Type = $type + } + $retRegKey.Entries += $entry + } + + foreach ($subKeyName in $RegKey.GetSubKeyNames()) { + $subKey = $RegKey.OpenSubKey($subKeyName) + Add-Registry -RegKey $subKey -Program $subKeyName + } + #Adding CustomObject to array declared in Get-RegistryPaths + $AllTVRegistryData.Add($retRegKey) | Out-Null +} + + + + + +function ConvertTo-DateTime { + param( + [Parameter(ValueFromPipeline)] + [string] + $InputString + ) + + process { + try { + Write-Output ([DateTime]::Parse($InputString)) + } + catch { + Write-Output $null + } + } +} + + +function ConvertTo-ErrorRecord { + param( + [Parameter(ValueFromPipeline)] + [object] + $InputObject, + + [Parameter()] + [System.Management.Automation.ErrorCategory] + $ErrorCategory = [System.Management.Automation.ErrorCategory]::NotSpecified + ) + Process { + $category = $ErrorCategory + $message = $InputObject.ToString() + $errorId = 'TeamViewerError' + + if ($InputObject.PSObject.TypeNames -contains 'TeamViewerPS.RestError') { + $category = switch ($InputObject.ErrorCategory) { + 'invalid_request' { [System.Management.Automation.ErrorCategory]::InvalidArgument } + 'invalid_token' { [System.Management.Automation.ErrorCategory]::AuthenticationError } + 'internal_error' { [System.Management.Automation.ErrorCategory]::NotSpecified } + 'rate_limit_reached' { [System.Management.Automation.ErrorCategory]::LimitsExceeded } + 'token_expired' { [System.Management.Automation.ErrorCategory]::AuthenticationError } + 'wrong_credentials' { [System.Management.Automation.ErrorCategory]::AuthenticationError } + 'invalid_client' { [System.Management.Automation.ErrorCategory]::InvalidArgument } + 'not_found' { [System.Management.Automation.ErrorCategory]::ObjectNotFound } + 'too_many_retries' { [System.Management.Automation.ErrorCategory]::LimitsExceeded } + 'invalid_permission' { [System.Management.Automation.ErrorCategory]::PermissionDenied } + default { [System.Management.Automation.ErrorCategory]::NotSpecified } + } + $errorId = 'TeamViewerRestError' + } + + $exception = [System.Management.Automation.RuntimeException]($message) + $errorRecord = New-Object System.Management.Automation.ErrorRecord $exception, $errorId, $category, $null + $errorRecord.ErrorDetails = $message + return $errorRecord + } +} + + + +function ConvertTo-TeamViewerAccount { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Name = $InputObject.name + Email = $InputObject.email + UserId = $InputObject.userid + CompanyName = $InputObject.company_name + IsEmailValidated = $InputObject.email_validated + EmailLanguage = $InputObject.email_language + } + if ($InputObject.email_language -And $InputObject.email_language -Ne 'auto') { + $properties["EmailLanguage"] = [System.Globalization.CultureInfo]($InputObject.email_language) + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Account') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.Name) <$($this.Email)>" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerAuditEvent { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Name = $InputObject.EventName + Type = $InputObject.EventType + Timestamp = $InputObject.Timestamp | ConvertTo-DateTime + Author = $InputObject.Author + AffectedItem = $InputObject.AffectedItem + EventDetails = $InputObject.EventDetails + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.AuditEvent') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "[$($this.Timestamp)] $($this.Name) ($($this.Type))" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerConnectionReport { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = $InputObject.id + UserId = $InputObject.userid + UserName = $InputObject.username + DeviceId = $InputObject.deviceid + DeviceName = $InputObject.devicename + GroupId = $InputObject.groupid + GroupName = $InputObject.groupname + SupportSessionType = [TeamViewerConnectionReportSessionType]$InputObject.support_session_type + StartDate = $InputObject.start_date | ConvertTo-DateTime + EndDate = $InputObject.end_date | ConvertTo-DateTime + SessionCode = $InputObject.session_code + Fee = $InputObject.fee + BillingState = $InputObject.billing_state + Currency = $InputObject.currency + Notes = $InputObject.notes + } + + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.ConnectionReport') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerContact { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = $InputObject.contact_id + UserId = $InputObject.user_id + GroupId = $InputObject.groupid + Name = $InputObject.name + Description = $InputObject.description + OnlineState = $InputObject.online_state + ProfilePictureUrl = $InputObject.profilepicture_url + SupportedFeatures = $InputObject.supported_features + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Contact') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.Name)" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerDevice { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $remoteControlId = $InputObject.remotecontrol_id | ` + Select-String -Pattern 'r(\d+)' | ` + ForEach-Object { $_.Matches.Groups[1].Value } + $properties = @{ + Id = $InputObject.device_id + TeamViewerId = $remoteControlId + GroupId = $InputObject.groupid + Name = $InputObject.alias + Description = $InputObject.description + OnlineState = $InputObject.online_state + IsAssignedToCurrentAccount = $InputObject.assigned_to + SupportedFeatures = $InputObject.supported_features + } + if ($InputObject.policy_id) { + $properties['PolicyId'] = $InputObject.policy_id + } + if ($InputObject.last_seen) { + $properties['LastSeenAt'] = [datetime]($InputObject.last_seen) + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Device') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.Name)" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerGroup { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = $InputObject.id + Name = $InputObject.name + Permissions = $InputObject.permissions + SharedWith = @($InputObject.shared_with | ConvertTo-TeamViewerGroupShare) + } + if ($InputObject.owner) { + $properties.Owner = [pscustomobject]@{ + UserId = $InputObject.owner.userid + Name = $InputObject.owner.name + } + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Group') + Write-Output $result + } +} + + +function ConvertTo-TeamViewerGroupShare { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + UserId = $InputObject.userid + Name = $InputObject.name + Permissions = $InputObject.permissions + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.GroupShare') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.UserId)" + } + Write-Output $result + } +} + + +function ConvertTo-TeamViewerManagedDevice { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = [guid]$InputObject.id + Name = $InputObject.name + TeamViewerId = $InputObject.TeamViewerId + IsOnline = $InputObject.isOnline + } + + if ($InputObject.last_seen) { + $properties['LastSeenAt'] = Get-Date -Date $InputObject.last_seen + } + + if ($InputObject.teamviewerPolicyId) { + $properties["PolicyId"] = [guid]$InputObject.teamviewerPolicyId + } + + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.ManagedDevice') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerManagedGroup { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = [guid]$InputObject.id + Name = $InputObject.name + } + if ($InputObject.policy_id) { + $properties["PolicyId"] = $InputObject.policy_id + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.ManagedGroup') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerManager { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject, + + [Parameter(Mandatory = $true, ParameterSetName = "GroupManager")] + [guid] + $GroupId, + + [Parameter(Mandatory = $true, ParameterSetName = "DeviceManager")] + [guid] + $DeviceId + ) + process { + $properties = @{ + Id = [guid]$InputObject.id + ManagerType = $InputObject.type + Name = $InputObject.name + Permissions = $InputObject.permissions + } + + switch ($InputObject.type) { + 'account' { + $properties.AccountId = $InputObject.accountId + } + 'company' { + $properties.CompanyId = $InputObject.companyId + } + } + + switch ($PsCmdlet.ParameterSetName) { + 'GroupManager' { + $properties.GroupId = $GroupId + } + 'DeviceManager' { + $properties.DeviceId = $DeviceId + } + } + + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Manager') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerPolicy { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + + process { + $properties = @{ + Id = $InputObject.policy_id + Name = $InputObject.name + Settings = @( + $InputObject.settings | ForEach-Object { + @{ + Key = $_.key + Value = $_.value + Enforce = $_.enforce + } + } + ) + } + + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.Policy') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerRestError { + param( + [parameter(ValueFromPipeline)] + $InputError + ) + Process { + try { + $errorObject = ($InputError | Out-String | ConvertFrom-Json) + $result = [PSCustomObject]@{ + Message = $errorObject.error_description + ErrorCategory = $errorObject.error + ErrorCode = $errorObject.error_code + ErrorSignature = $errorObject.error_signature + } + $result | Add-Member -MemberType ScriptMethod -Name 'ToString' -Force -Value { + Write-Output "$($this.Message) ($($this.ErrorCategory))" + } + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.RestError') + return $result + } + catch { + return $InputError + } + } +} + + + +function ConvertTo-TeamViewerRoleAssignedUser { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{AssignedUsers = ($InputObject.trim('u'))} + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.RoleAssignedUser') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerRoleAssignedUserGroup { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{AssignedGroups = ($InputObject)} + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.RoleAssignedUserGroup') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerSsoDomain { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = $InputObject.DomainId + Name = $InputObject.DomainName + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.SsoDomain') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.Name)" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerUser { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject, + + [Parameter()] + [ValidateSet('All', 'Minimal')] + $PropertiesToLoad = 'All' + ) + process { + $properties = @{ + Id = $InputObject.id + Name = $InputObject.name + Email = $InputObject.email + } + if ($PropertiesToLoad -Eq 'All') { + $properties += @{ + Permissions = $InputObject.permissions -split ',' + Active = $InputObject.active + LastAccessDate = $InputObject.last_access_date | ConvertTo-DateTime + } + if ($InputObject.activated_license_id) { + $properties += @{ + ActivatedLicenseId = [guid]$InputObject.activated_license_id + ActivatedLicenseName = $InputObject.activated_license_name + ActivatedSubLicenseName = $InputObject.activated_subLicense_name + } + } + if ($InputObject.activated_meeting_license_key) { + $properties += @{ + ActivatedMeetingLicenseId = [guid]$InputObject.activated_meeting_license_key + } + } + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.User') + $result | Add-Member -MemberType ScriptMethod -Name "ToString" -Force -Value { + Write-Output "$($this.Name) <$($this.Email)>" + } + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerUserGroup { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + Id = [UInt64]$InputObject.id + Name = $InputObject.name + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.UserGroup') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerUserGroupMember { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + AccountId = [int]$InputObject.accountId + Name = $InputObject.name + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.UserGroupMember') + Write-Output $result + } +} + + + +function ConvertTo-TeamViewerUserRole { + param( + [Parameter(ValueFromPipeline)] + [PSObject] + $InputObject + ) + process { + $properties = @{ + RoleName = $InputObject.Name + RoleID = $InputObject.Id + } + if ($InputObject.Permissions) { + foreach ($permission in $InputObject.Permissions.PSObject.Properties) { + $properties[$permission.Name] = $permission.Value + } + } + $result = New-Object -TypeName PSObject -Property $properties + $result.PSObject.TypeNames.Insert(0, 'TeamViewerPS.UserRole') + $result | Add-Member -MemberType ScriptMethod -Name 'ToString' -Force -Value { + Write-Output "[$($this.RoleName)] [$($this.RoleID)] $($this.Permissions))" + } + Write-Output $result + } +} + + + + +function Get-ClientId { + if (Test-Path -Path 'HKLM:\SOFTWARE\Wow6432Node\TeamViewer') { + $mainKey = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\TeamViewer' + $id = [int]$mainKey.ClientID + } + elseif (Test-Path -Path 'HKLM:\Software\TeamViewer') { + $mainKey = Get-ItemProperty -Path 'HKLM:\Software\TeamViewer' + $id = [int]$mainKey.ClientID + } + return $id +} + + + +function Get-HostFile { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + process { + $regPath = 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + $regKey = Get-ItemProperty -Path $regPath + $hostsPath = Join-Path -Path $regKey.DataBasePath -ChildPath 'hosts' + $hostsFile = Get-Content -Path $hostsPath + $hostsFile | Out-File -FilePath "$OutputPath\Data\hosts.txt" + Write-Output "hosts file collected and saved to $OutputPath\Data\hosts.txt" + } +} + + + +function Get-InstalledSoftware { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + Begin { + $regUninstall = @{ + InstalledSoftware32 = 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' + InstalledSoftware64 = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' + } + } + Process { + foreach ($Name in $regUninstall.keys) { + $regKeys = $regUninstall[$Name] + $regKey = Get-ItemProperty -Path "$regKeys\*" + if ($null -ne $regKey) { + $subKeys = $regKey.PSChildName + if ($null -ne $subKeys) { + $installedPrograms = @() + foreach ($subKey in $subKeys) { + $tmpSubkey = Get-ItemProperty -Path "$regKeys\$subKey" + $programmName = $tmpSubkey.DisplayName + $displayVersion = $tmpSubkey.DisplayVersion + if ($null -ne $programmName) { + $tmpSoftwareData = "$programmName | $displayVersion" + $installedPrograms += $tmpSoftwareData + } + } + } + $installedPrograms | Sort-Object | Out-File -FilePath "$OutputPath\Data\$Name.txt" + Write-Output "$Name collected and saved to $OutputPath\Data\$Name.txt" + } + } + } +} + + + + + +function Get-IpConfig { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + Process { + try { + ipconfig /all | Out-File -FilePath "$OutputPath\Data\ipconfig.txt" -Encoding utf8 + Write-Output "ipconfig data collected and saved to $OutputPath\Data\ipconfig.txt" + } + catch { + Write-Error "An error occurred while collecting ipconfig data: $_" + } + } +} + + + +function Get-MSInfo32 { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + Process { + try { + Start-Process -FilePath msinfo32.exe -ArgumentList "/nfo $OutputPath\Data\msinfo32.nfo" -Wait + + Write-Output "msinfo data collected and saved to $OutputPath\Data\msinfo32.nfo" + } + catch { + Write-Error "An error occurred while collecting msinfo data: $_" + } + } +} + + + +function Get-NSLookUpData { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + Begin { + $Ipv4DnsServer = @($null, 'tv-ns1.teamviewer.com', 'tv-ns2.teamviewer.com', 'tv-ns3.teamviewer.com', + 'tv-ns4.teamviewer.com', 'tv-ns5.teamviewer.com', '8.8.8.8', '1.1.1.1') + $Ipv4DnsName = @( 'master1.teamviewer.com', 'router1.teamviewer.com', 'google.com', + 'login.teamviewer.com', 'www.teamviewer.com') + $output = $null + } + Process { + try { + foreach ($DnsName in $Ipv4DnsName ) { + foreach ($DnsServer in $Ipv4DnsServer) { + Write-Output "Collecting nslookup.exe information from $DnsName $DnsServer. This might take a while" + $output += "nslookup information for: $DnsName $DnsServer `r`n" + $arguments = "-debug ""$DnsName""" + if ($DnsServer) { + $arguments += " ""$DnsServer""" + } + $processInfo = New-Object System.Diagnostics.ProcessStartInfo + $processInfo.FileName = 'nslookup.exe' + $processInfo.Arguments = $arguments + $processInfo.WindowStyle = 'Hidden' + $processInfo.UseShellExecute = $false + $processInfo.RedirectStandardOutput = $true + + $process = [System.Diagnostics.Process]::Start($processInfo) + $output += $process.StandardOutput.ReadToEnd() + $process.WaitForExit(60000) + if (-not $process.HasExited) { + $process.Kill() + continue + } + $output += $process.StandardOutput.ReadToEnd() + } + } + $output | Out-File "$OutputPath\Data\nslookup.txt" + } + + catch { + Write-Error "Error collecting nslookup information: $_" + } + } +} + + + + + +function Get-OperatingSystem { + if ($IsLinux) { + return 'Linux' + } + if ($IsMacOS) { + return 'MacOS' + } + if ($IsWindows -Or $env:OS -match '^Windows') { + return 'Windows' + } +} + + + +function Get-RegistryPath { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + Begin { + $SearchProgramms = @('TeamViewer', 'Blizz', 'TeamViewerMeeting') + $RegistrySearchPathsLocalMachine = @('SOFTWARE\Wow6432Node', 'SOFTWARE') + $RegistrySearchPathsCurrentUser = @('SOFTWARE') + $AllTVRegistryData = New-Object System.Collections.ArrayList + } + + Process { + foreach ($searchProgramm in $SearchProgramms) { + foreach ($registrySearchPath in $RegistrySearchPathsLocalMachine) { + $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("$registrySearchPath\$searchProgramm", $false) + if ($regKey) { + Add-Registry -RegKey $regKey -Program $searchProgramm + } + } + + foreach ($registrySearchPath in $RegistrySearchPathsCurrentUser) { + $regKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey("$registrySearchPath\$searchProgramm", $false) + if ($searchProgramm -eq 'Blizz' -or $searchProgramm -eq 'TeamViewerMeeting') { + $regKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey("$registrySearchPath\$searchProgramm\MachineFallback", $false) + } + if ($regKey) { + Add-Registry -RegKey $regKey -Program $searchProgramm + } + } + + $output = "Windows Registry Editor Version 5.00 `r`n" + foreach ($data in $AllTVRegistryData) { + $output += "[$($data.RegistryPath)]`r`n" + foreach ($entry in $data.Entries) { + if ($null -ne $entry.name) { + $output += """$($entry.Name)""" + $entry.Type + $entry.Value + "`r`n" + } + } + $output += "`r`n" + } + $output | Out-File -FilePath "$OutputPath\Data\TeamViewer_Version15\Reg_Version15.txt" + } + } + +} + + + +function Get-RouteTable { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) +Process{ + try { + $processInfo = New-Object System.Diagnostics.ProcessStartInfo + $processInfo.FileName = 'route.exe' + $processInfo.Arguments = 'print' + $processInfo.WindowStyle = 'Hidden' + $processInfo.UseShellExecute = $false + $processInfo.RedirectStandardOutput = $true + + $process = [System.Diagnostics.Process]::Start($processInfo) + $output = $process.StandardOutput.ReadToEnd() + $output | Out-File "$OutputPath\Data\RouteTable.txt" + } + catch { + Write-Error "An error occurred while collecting RouteTable data: $_" + } +} +} + + + + + +class TeamViewerConfiguration { + [string]$APIUri = 'https://webapi.teamviewer.com/api/v1' + + static [TeamViewerConfiguration] $Instance = $null + + static [TeamViewerConfiguration] GetInstance() { + if (-not [TeamViewerConfiguration]::Instance) { + [TeamViewerConfiguration]::Instance = [TeamViewerConfiguration]::new() + } + + return [TeamViewerConfiguration]::Instance + } +} + +function Get-TeamViewerAPIUri { + $config = [TeamViewerConfiguration]::GetInstance() + return $config.APIUri +} + + + + + +function Get-TeamViewerLinuxGlobalConfig { + param( + [Parameter()] + [string] + $Path = '/opt/teamviewer/config/global.conf', + + [Parameter()] + [string] + $Name + ) + $config = & sudo pwsh -command Get-Content $Path | ForEach-Object { + if ($_ -Match '\[(?\w+)\s*\]\s+(?[\w\\]+)\s+=\s*(?.*)$') { + $Matches.Remove(0) + $entry = [pscustomobject]$Matches + switch ($entry.EntryType) { + 'strng' { + $entry.EntryValue = $entry.EntryValue | ` + Select-String -Pattern '"([^\"]*)"' -AllMatches | ` + Select-Object -ExpandProperty Matches | ` + ForEach-Object { $_.Groups[1].Value } + } + 'int32' { + $entry.EntryValue = [int32]($entry.EntryValue) + } + 'int64' { + #In some cases the EntryName DeviceManagement/TransitionNonces is set to entryvalue '0 0 0 0 0' of type int64 + if ($entry.EntryValue -notmatch '0 0 0 0 0') { + $entry.EntryValue = [int64]($entry.EntryValue) + } + } + } + $entry + } + } + + if ($Name) { + ($config | Where-Object { $_.EntryName -eq $Name }).EntryValue + } + else { + $config + } +} + + + +function Get-TeamViewerRegKeyPath { + param ( + [Parameter()] + [ValidateSet('WOW6432', 'Auto')] + [string] + $Variant = 'Auto' + ) + if (($Variant -eq 'WOW6432') -Or (Test-TeamViewer32on64)) { + Write-Output 'HKLM:\SOFTWARE\Wow6432Node\TeamViewer' + } + else { + Write-Output 'HKLM:\SOFTWARE\TeamViewer' + } +} + + + +function Get-TeamViewerServiceName { + Write-Output 'TeamViewer' +} + + + +function Get-TSCDirectoryFile { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $OutputPath + ) + + Process { + $SearchDirectories = Get-TSCSearchDirectory + $TempDirectory = New-Item -Path $OutputPath -Name 'Data' -ItemType Directory -Force + $Endings = @('.log', 'tvinfo.ini', '.mdmp', 'Connections.txt', 'Connections_incoming.txt') + $TmpLogFiles = @() + foreach ($Name in $SearchDirectories.Keys) { + $SearchDirectory = $SearchDirectories[$Name] + foreach ($Folder in $SearchDirectory) { + if (Test-Path -Path $Folder) { + $TempSubdirectory = Join-Path -Path $TempDirectory -ChildPath $Name + New-Item -Path $TempSubdirectory -ItemType Directory -Force | Out-Null + $files = Get-ChildItem -Path $Folder -File -Recurse + foreach ($file in $files) { + foreach ($ending in $Endings) { + if ($file.Name.EndsWith($ending)) { + $tmpLogfilePath = Join-Path -Path $TempSubdirectory -ChildPath $file.Name + Copy-Item -Path $file.FullName -Destination $tmpLogfilePath -Force + $TmpLogFiles += $tmpLogfilePath + Write-Output "Collected log file from $($file.FullName)" + } + } + } + } + } + } + Write-Output 'Files from TeamViewer directories have been collected.' + } +} + + + +function Get-TSCSearchDirectory { + $LocalAppData = [System.Environment]::GetFolderPath('LocalApplicationData') + $RoamingAppData = [System.Environment]::GetFolderPath('ApplicationData') + $TVAppData = Join-Path -Path $LocalAppData.ToString() -ChildPath 'TeamViewer/Logs' + $TVRoamingData = Join-Path -Path $RoamingAppData.ToString() -ChildPath 'TeamViewer' + $InstallationDirectory = Get-TeamViewerInstallationDirectory + + $TSCSearchDirectory = @{ + 'TeamViewer_Version15' = $InstallationDirectory + 'AppData\TeamViewer' = @($TVAppData; $TVRoamingData) + } + + return $TSCSearchDirectory +} + + + +function Get-TypeAndValueOfRegistryValue { + param ( + [Microsoft.Win32.RegistryKey]$RegKey, + [string]$ValueName + ) + + $valueKind = $RegKey.GetValueKind($ValueName) + $type = $valueKind + + if ($valueKind -eq 'DWord') { + $type = "=dword:" + $value = [Convert]::ToInt32($RegKey.GetValue($ValueName)).ToString('x') + } + elseif ($valueKind -eq 'Binary') { + $type = "=hex:" + $value = ($RegKey.GetValue($ValueName) | ForEach-Object { $_.ToString('x2') }) -join ',' + } + elseif ($valueKind -eq 'String') { + $type = "=" + $value = $RegKey.GetValue($ValueName).ToString() + } + elseif ($valueKind -eq 'MultiString') { + $type = "=hex(7):" + $value += ($RegKey.GetValue($ValueName) | ForEach-Object { + $_.ToCharArray() | ForEach-Object { [Convert]::ToInt32($_).ToString('X') + ',00' } + }) -join ',' + $value += ',00,00,' + if ($value.Length -gt 0) { + $value += '00,00' + } + } + else { + $type = "" + $value = $RegKey.GetValue($ValueName).ToString() + } + + return $type, $value +} + + + + +function Invoke-ExternalCommand { + param( + [Parameter(Mandatory = $true, Position = 0)] + [string] + $Command, + + [Parameter(ValueFromRemainingArguments = $true)] + [object[]] + $CommandArgs + ) + & $Command @CommandArgs +} + + + +function Invoke-TeamViewerRestMethod { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [uri] + $Uri, + + [Microsoft.PowerShell.Commands.WebRequestMethod] + $Method, + + [System.Collections.IDictionary] + $Headers, + + [System.Object] + $Body, + + [string] + $ContentType, + + [System.Management.Automation.PSCmdlet] + $WriteErrorTo + + ) + + if (-Not $Headers) { + $Headers = @{ } + $PSBoundParameters.Add('Headers', $Headers) | Out-Null + } + + if ($global:TeamViewerProxyUriSet) { + $Proxy = $global:TeamViewerProxyUriSet + } + elseif ([Environment]::GetEnvironmentVariable('TeamViewerProxyUri') ) { + $Proxy = [Environment]::GetEnvironmentVariable('TeamViewerProxyUri') + if ($global:TeamViewerProxyUriRemoved) { + $Proxy = $null + } + } + If ($Proxy) { + $PSBoundParameters.Add('Proxy', $Proxy) | Out-Null + } + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($ApiToken) + $Headers['Authorization'] = "Bearer $([System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr))" + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + $PSBoundParameters.Remove('ApiToken') | Out-Null + $PSBoundParameters.Remove('WriteErrorTo') | Out-Null + + $currentTlsSettings = [Net.ServicePointManager]::SecurityProtocol + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + + $currentProgressPreference = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + + + # Using `Invoke-WebRequest` instead of `Invoke-RestMethod`: + # There is a known issue for PUT and DELETE operations to hang on Windows Server 2012. + try { + + return ((Invoke-WebRequest -UseBasicParsing @PSBoundParameters).Content | ConvertFrom-Json) + } + catch { + $msg = $null + if ($PSVersionTable.PSVersion.Major -ge 6) { + $msg = $_.ErrorDetails.Message + } + elseif ($_.Exception.Response) { + $stream = $_.Exception.Response.GetResponseStream() + $reader = New-Object System.IO.StreamReader($stream) + $reader.BaseStream.Position = 0 + $msg = $reader.ReadToEnd() + } + $err = ($msg | ConvertTo-TeamViewerRestError) + if ($WriteErrorTo) { + $WriteErrorTo.WriteError(($err | ConvertTo-ErrorRecord)) + } + else { + throw $err + } + } + finally { + [Net.ServicePointManager]::SecurityProtocol = $currentTlsSettings + $ProgressPreference = $currentProgressPreference + } +} + + + +function Resolve-AssignmentErrorCode { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $exitCode + ) + Begin { + $exitCodeMessages = @{ + 0 = 'Operation successful' + 1 = 'Misspelled or used a wrong command' + 2 = 'Signature verification error' + 3 = 'TeamViewer is not installed' + 4 = 'The assignment configuration could not be verified against the TeamViewer Cloud.Try again later.' + 400 = 'Invalid assignment ID' + 401 = 'TeamViewer service not running' + 402 = 'Service Incompatible Version' + 403 = 'Check your internet connection' + 404 = 'Another assignment process running' + 405 = 'Timeout' + 406 = 'Failed due to unknown reasons' + 407 = 'Access denied. Ensure local administrator rights' + 408 = 'Denied by policy' + } + } + Process { + if ($exitCode) { + if ($exitCodeMessages.ContainsKey($exitCode)) { + Write-Output $exitCodeMessages[$exitCode] + } + else { + Write-Output "Unexpected error code: $exitCode. Check TeamViewer documentation!" + } + } + elseif ($exitCode -eq 0) { + Write-Output $exitCodeMessages[$exitCode] + } + } +} + + + +function Resolve-CustomizationErrorCode { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $exitCode + ) + Begin { + $exitCodeMessages = @{ + 0 = 'Operation successful' + 1 = 'Invalid command line arguments' + 500 = 'An internal error occurred. See TeamViewer log files for more details!' + 501 = 'The current user was denied access' + 502 = 'The download of the custom configuration timed out' + 503 = 'Invalid Module' + 504 = 'Restart of the GUI failed' + 505 = 'Custom configuration failed. See the TeamViewer log files for more details and check if the custom configuration id is still valid.' + 506 = 'Removal of custom configuration failed. See the TeamViewer log files for more details!' + } + } + Process { + if ($exitCode) { + if ($exitCodeMessages.ContainsKey($exitCode)) { + Write-Output $exitCodeMessages[$exitCode] + } + else { + Write-Output "Unexpected error code: $exitCode. Check TeamViewer documentation!" + } + } + elseif ($exitCode -eq 0) { + Write-Output $exitCodeMessages[$exitCode] + } + } +} + + + +function Resolve-TeamViewerContactId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Contact + ) + Process { + if ($Contact.PSObject.TypeNames -contains 'TeamViewerPS.Contact') { + return $Contact.Id + } + elseif ($Contact -is [string]) { + if ($Contact -notmatch 'c[0-9]+') { + throw "Invalid contact identifier '$Contact'. String must be a contact ID in the form 'c123456789'." + } + return $Contact + } + else { + throw "Invalid contact identifier '$Contact'. Must be either a [TeamViewerPS.Contact] or [string]." + } + } +} + + + +function Resolve-TeamViewerDeviceId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Device + ) + Process { + if ($Device.PSObject.TypeNames -contains 'TeamViewerPS.Device') { + return $Device.Id + } + elseif ($Device -is [string]) { + if ($Device -notmatch 'd[0-9]+') { + throw "Invalid device identifier '$Device'. String must be a device ID in the form 'd123456789'." + } + return $Device + } + else { + throw "Invalid device identifier '$Device'. Must be either a [TeamViewerPS.Device] or [string]." + } + } +} + + + +function Resolve-TeamViewerGroupId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Group + ) + Process { + if ($Group.PSObject.TypeNames -contains 'TeamViewerPS.Group') { + return $Group.Id + } + elseif ($Group -is [string]) { + if ($Group -notmatch 'g[0-9]+') { + throw "Invalid group identifier '$Group'. String must be a group ID in the form 'g123456789'." + } + return $Group + } + else { + throw "Invalid group identifier '$Group'. Must be either a [TeamViewerPS.Group] or [string]." + } + } +} + + + +function Resolve-TeamViewerLanguage { + param( + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [object] + $InputObject + ) + Process { + $supportedLanguages = @( + 'bg', 'cs', 'da', 'de', 'el', 'en', 'es', 'fi', 'fr', 'hr', 'hu', 'id', 'it', 'ja', + 'ko', 'lt', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sr', 'sv', 'th', 'tr', 'uk', + 'vi', 'zh_CN', 'zh_TW', 'auto') + + $language = $InputObject + if ($InputObject -is [cultureinfo]) { + $language = switch ($InputObject.Name) { + 'zh-CN' { 'zh_CN' } + 'zh-TW' { 'zh_TW' } + default { $InputObject.TwoLetterISOLanguageName } + } + } + + if ($supportedLanguages -notcontains $language) { + throw "Invalid culture '$language'. Supported languages are: $supportedLanguages" + } + + return $language + } +} + + + +function Resolve-TeamViewerManagedDeviceId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $ManagedDevice + ) + Process { + if ($ManagedDevice.PSObject.TypeNames -contains 'TeamViewerPS.ManagedDevice') { + return [guid]$ManagedDevice.Id + } + elseif ($ManagedDevice -is [string]) { + return [guid]$ManagedDevice + } + elseif ($ManagedDevice -is [guid]) { + return $ManagedDevice + } + else { + throw "Invalid managed device identifier '$ManagedDevice'. Must be either a [TeamViewerPS.ManagedDevice], [guid] or [string]." + } + } +} + + + +function Resolve-TeamViewerManagedGroupId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $ManagedGroup + ) + Process { + if ($ManagedGroup.PSObject.TypeNames -contains 'TeamViewerPS.ManagedGroup') { + return [guid]$ManagedGroup.Id + } + elseif ($ManagedGroup -is [string]) { + return [guid]$ManagedGroup + } + elseif ($ManagedGroup -is [guid]) { + return $ManagedGroup + } + else { + throw "Invalid managed group identifier '$ManagedGroup'. Must be either a [TeamViewerPS.ManagedGroup], [guid] or [string]." + } + } +} + + + +function Resolve-TeamViewerManagerId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Manager + ) + Process { + if ($Manager.PSObject.TypeNames -contains 'TeamViewerPS.Manager') { + return [guid]$Manager.Id + } + elseif ($Manager -is [string]) { + return [guid]$Manager + } + elseif ($Manager -is [guid]) { + return $Manager + } + else { + throw "Invalid manager identifier '$Manager'. Must be either a [TeamViewerPS.Manager], [guid] or [string]." + } + } +} + + + +function Resolve-TeamViewerPolicyId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Policy, + + [Parameter()] + [switch] + $AllowNone, + + [Parameter()] + [switch] + $AllowInherit + ) + Process { + if ($Policy.PSObject.TypeNames -contains 'TeamViewerPS.Policy') { + return [guid]$Policy.Id + } + elseif ($Policy -is [string]) { + if ($Policy -eq 'none' -And $AllowNone) { + return 'none' + } + elseif ($Policy -eq 'inherit' -And $AllowInherit) { + return 'inherit' + } + else { + return [guid]$Policy + } + } + elseif ($Policy -is [guid]) { + return $Policy + } + else { + throw "Invalid policy identifier '$Policy'. Must be either a [TeamViewerPS.Policy], [guid] or [string]." + } + } +} + + + +function Resolve-TeamViewerSsoDomainId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $Domain + ) + Process { + if ($Domain.PSObject.TypeNames -contains 'TeamViewerPS.SsoDomain') { + return [guid]$Domain.Id + } + elseif ($Domain -is [string]) { + return [guid]$Domain + } + elseif ($Domain -is [guid]) { + return $Domain + } + else { + throw "Invalid SSO domain identifier '$Domain'. Must be either a [TeamViewerPS.SsoDomain], [guid] or [string]." + } + } +} + + + +function Resolve-TeamViewerUserEmail { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $false)] + [object] + $User + ) + Process { + if (!$User) { + return $null + } + elseif ($User.PSObject.TypeNames -contains 'TeamViewerPS.User') { + return $User.Email + } + elseif ($User -is [string]) { + return $User + } + else { + throw "Invalid user email '$User'. Must be either a [TeamViewerPS.User] or [string]." + } + } +} + + + +function Resolve-TeamViewerUserGroupId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $UserGroup + ) + Process { + if ($UserGroup.PSObject.TypeNames -contains 'TeamViewerPS.UserGroup') { + return [UInt64]$UserGroup.Id + } + elseif ($UserGroup -is [string]) { + return [UInt64]$UserGroup + } + elseif ($UserGroup -is [UInt64] -or $UserGroup -is [Int64] -or $UserGroup -is [int]) { + return [UInt64]$UserGroup + } + else { + throw "Invalid user group identifier '$UserGroup'. Must be either a [TeamViewerPS.UserGroup], [UInt64], [Int64] or [string]." + } + } +} + + + +function Resolve-TeamViewerUserGroupMemberMemberId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $UserGroupMember + ) + Process { + if ($UserGroupMember.PSObject.TypeNames -contains 'TeamViewerPS.UserGroupMember') { + return $UserGroupMember.AccountId + } + elseif ($UserGroupMember -match 'u[0-9]+') { + return $UserGroupMember + } + elseif ($UserGroupMember -is [string]) { + return [int]$UserGroupMember + } + elseif ($UserGroupMember -is [int]) { + return $UserGroupMember + } + else { + throw "Invalid user group identifier '$UserGroupMember'. Must be either a [TeamViewerPS.UserGroupMember],[TeamViewerPS.User] or [int] ." + } + } +} + + + +function Resolve-TeamViewerUserId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $User + ) + Process { + if ($User.PSObject.TypeNames -contains 'TeamViewerPS.User') { + return $User.Id + } + elseif ($User -is [string]) { + if ($User -notmatch 'u[0-9]+') { + throw "Invalid user identifier '$User'. String must be a user ID in the form 'u123456789'." + } + return $User + } + else { + throw "Invalid user identifier '$User'. Must be either a [TeamViewerPS.User] or [string]." + } + } +} + + + + +function Resolve-TeamViewerUserRoleId { + param( + [Parameter(ValueFromPipeline = $true, Mandatory = $true)] + [object] + $UserRole + ) + Process { + if ($UserRole.PSObject.TypeNames -contains 'TeamViewerPS.UserRole') { + return [string]$UserRole.RoleID + } + elseif ($UserRole -match '^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$') { + return [string]$UserRole + } + else { + throw "Invalid role group identifier '$UserRole'. Must be either a [TeamViewerPS.UserRole] or [UUID] " + } + } +} + + + +$hasTestNetConnection = [bool](Get-Command Test-NetConnection -ErrorAction SilentlyContinue) +$hasTestConnection = [bool](Get-Command Test-Connection -ErrorAction SilentlyContinue | Where-Object { $_.Version -ge 5.1 }) + +function Test-TcpConnection { + param( + [Parameter(Mandatory = $true)] + [string] + $Hostname, + + [Parameter(Mandatory = $true)] + [int] + $Port + ) + + if (-Not $hasTestNetConnection -And -Not $hasTestConnection) { + throw "No suitable cmdlet found for testing the TeamViewer network connectivity." + } + + $oldProgressPreference = $global:ProgressPreference + $global:ProgressPreference = 'SilentlyContinue' + + if ($hasTestNetConnection) { + Test-NetConnection -ComputerName $Hostname -Port $Port -InformationLevel Quiet -WarningAction SilentlyContinue + } + elseif ($hasTestConnection) { + Test-Connection -TargetName $Hostname -TcpPort $Port -Quiet -WarningAction SilentlyContinue + } + else { + $false + } + + $global:ProgressPreference = $oldProgressPreference +} + + + +function Test-TeamViewer32on64 { + if (![Environment]::Is64BitOperatingSystem) { + return $false + } + $registryKey = Get-TeamViewerRegKeyPath -Variant WOW6432 + if (!(Test-Path $registryKey)) { + return $false + } + try { + $installationDirectory = (Get-Item $registryKey).GetValue('InstallationDirectory') + $binaryPath = Join-Path $installationDirectory 'TeamViewer.exe' + return Test-Path $binaryPath + } + catch { + return $false + } +} + + + +function Add-TeamViewerAssignment { + param( + [Parameter(Mandatory = $true)] + [object] + $AssignmentId, + + [string] + $DeviceAlias, + + [int] + $Retries + ) + + + if (Test-TeamViewerInstallation) { + $OS = Get-OperatingSystem + $CurrentDirectory = Get-Location + $installationDirectory = Get-TeamViewerInstallationDirectory + Set-Location $installationDirectory + $CurrentVersion = Get-TeamViewerVersion + $VersionTable = $CurrentVersion.split('.') + if ($OS -eq 'Windows') { + $cmd = "assignment --id $AssignmentId" + $FilePath = 'TeamViewer.exe' + } + elseif ($OS -eq 'Linux') { + $cmd = "teamviewer assignment --id $AssignmentId" + $FilePath = 'sudo' + } + + if ($DeviceAlias) { + if (($VersionTable[0] -eq 15 -and $VersionTable[1] -ge 44) -or $VersionTable[0] -gt 15) { + $cmd += " --device-alias=$DeviceAlias" + } + else { + Write-Error "Current TeamViewer Version: $CurrentVersion does not support the usage of alias. Please update to the latest version." + Set-Location $CurrentDirectory + exit + } + } + if ($Retries) { + $cmd += " --retries=$Retries" + } + $process = Start-Process -FilePath $FilePath -ArgumentList $cmd -Wait -PassThru + $process.ExitCode | Resolve-AssignmentErrorCode + Set-Location $CurrentDirectory + } + else { + Write-Output 'TeamViewer is not installed.' + } +} + + + + + +Function Add-TeamViewerCustomization { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, ParameterSetName = 'ById')] + [object] + $Id, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByPath')] + [object] + $Path, + + [switch] + $RestartGUI, + + [switch] + $RemoveExisting + ) + + if (Get-OperatingSystem -eq 'Windows') { + if (Test-TeamViewerInstallation) { + $installationDirectory = Get-TeamViewerInstallationDirectory + $currentDirectory = Get-Location + Set-Location $installationDirectory + $cmd = 'customize' + if ($Id) { + $cmd += " --id $Id" + } + elseif ($Path) { + $cmd += " --path $Path" + } + if ($RemoveExisting) { + $cmd += ' --remove' + } + if ($RestartGUI) { + $cmd += ' --restart-gui' + } + $process = Start-Process -FilePath TeamViewer.exe -ArgumentList $cmd -Wait -PassThru + $process.ExitCode | Resolve-CustomizationErrorCode + Set-Location $currentDirectory + } + else { + Write-Error 'TeamViewer is not installed' + } + } + else { + Write-Error 'Customization is currently supported only on Windows.' + } +} + + + +function Add-TeamViewerManagedDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [object] + $Group + ) + + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/devices" + + $body = @{ + id = $deviceId + } + + if ($PSCmdlet.ShouldProcess($deviceId, "Add device to managed group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function Add-TeamViewerManager { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'Device_ByAccountId')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByAccountId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByAccountId')] + [string] + $AccountId, + + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByManagerId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByManagerId')] + [ValidateScript( { $_ | Resolve-TeamViewerManagerId } )] + [Alias("ManagerId")] + [object] + $Manager, + + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByUserObject')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByUserObject')] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [object] + $User, + + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByUserGroupId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByUserGroupId')] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId })] + [Alias('UserGroupId')] + [object] + $UserGroup, + + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByAccountId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByManagerId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByUserObject')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByUserGroupId')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByAccountId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByManagerId')] + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByUserObject')] + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByUserGroupId')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter()] + [AllowEmptyCollection()] + [string[]] + $Permissions + ) + + $resourceUri = $null + switch -Wildcard ($PSCmdlet.ParameterSetName) { + 'Device*' { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/managers" + $processMessage = "Add manager to managed device" + } + 'Group*' { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/managers" + $processMessage = "Add manager to managed group" + } + } + + $body = @{} + switch -Wildcard ($PSCmdlet.ParameterSetName) { + '*ByAccountId' { + $body["accountId"] = $AccountId.TrimStart('u') + } + '*ByManagerId' { + $body["id"] = $Manager | Resolve-TeamViewerManagerId + } + '*ByUserObject' { + $body["accountId"] = ( $User | Resolve-TeamViewerUserId ).TrimStart('u') + } + '*ByUserGroupId' { + $body["usergroupId"] = $UserGroup | Resolve-TeamViewerUserGroupId + } + } + + if ($Permissions) { + $body["permissions"] = @($Permissions) + } + else { + $body["permissions"] = @() + } + + if ($PSCmdlet.ShouldProcess($managerId, $processMessage)) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes((ConvertTo-Json -InputObject @($body)))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function Add-TeamViewerRoleToAccount { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRole')] + [object] + $UserRoleId, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('Id', 'UserIds')] + [string[]] + $Accounts + ) + + Begin { + $id = $UserRoleId | Resolve-TeamViewerUserRoleId + $null = $ApiToken + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/assign/account" + $AccountsToAdd = @() + $body = @{ + UserIds = @() + UserRoleId = $id + } + function Invoke-TeamViewerRestMethodInternal { + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($result) + } + } + + + Process { + if ($PSCmdlet.ShouldProcess($Accounts, 'Assign Account to Role')) { + if (($Accounts -notmatch 'u[0-9]+') -and ($Accounts -match '[0-9]+')) { + $Accounts = $Accounts | ForEach-Object { $_.Insert(0, 'u') } + } + foreach ($Account in $Accounts) { + $AccountsToAdd += $Account + $body.UserIds = @($AccountsToAdd) + } + } + if ($AccountsToAdd.Length -eq 100) { + Invoke-TeamViewerRestMethodInternal + $AccountsToAdd = @() + } + } + End { + if ($AccountsToAdd.Length -gt 0) { + Invoke-TeamViewerRestMethodInternal + } + } +} + + + + +function Add-TeamViewerRoleToUserGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRoleId')] + [object] + $UserRole, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias('UserGroupId')] + [Alias('Id')] + [object] + $UserGroup + ) + + Begin { + $RoleId = $UserRole | Resolve-TeamViewerUserRoleId + $null = $ApiToken + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/assign/usergroup" + $body = @{ + UserRoleId = $RoleId + UserGroupId = $UserGroup + + } + } + + + Process { + if ($PSCmdlet.ShouldProcess($UserGroup, 'Assign Role to User Group')) { + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($result) + } + } +} + + + +function Add-TeamViewerSsoExclusion { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerSsoDomainId } )] + [Alias("Domain")] + [object] + $DomainId, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [string[]] + $Email + ) + Begin { + $id = $DomainId | Resolve-TeamViewerSsoDomainId + $resourceUri = "$(Get-TeamViewerApiUri)/ssoDomain/$id/exclusion" + $emailsToAdd = @() + $null = $ApiToken # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + + function Invoke-RequestInternal { + $body = @{ + emails = @($emailsToAdd) + } + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } + Process { + if ($PSCmdlet.ShouldProcess($Email, "Add SSO exclusion")) { + $emailsToAdd += $Email + } + if ($emailsToAdd.Length -eq 100) { + Invoke-RequestInternal + $emailsToAdd = @() + } + } + End { + if ($emailsToAdd.Length -gt 0) { + Invoke-RequestInternal + } + } +} + + + +function Add-TeamViewerUserGroupMember { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias('UserGroupId')] + [Alias('Id')] + [object] + $UserGroup, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [object[]] + [Alias('UserGroupMemberId')] + [Alias('UserGroupMember')] + [Alias('MemberId')] + [Alias('UserId')] + [Alias('User')] + $Member + ) + + Begin { + $id = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups/$id/members" + $membersToAdd = @() + $body = @() + $null = $ApiToken # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + + function Invoke-TeamViewerRestMethodInternal { + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + Write-Output ($result | ConvertTo-TeamViewerUserGroupMember) + } + } + + Process { + # when members are provided as pipeline input, each member is provided as a separate statement, + # thus the members should be combined into one array in order to send a single request. + if ($PSCmdlet.ShouldProcess($Member, 'Add user groups member')) { + if ($Member -notmatch 'u[0-9]+') { + ForEach-Object { + $Member = [int[]]$Member + } + } + else { + ForEach-Object { + $Member = [int[]]$Member.trim('u') + } + } + if ($Member -isnot [array]) { + $membersToAdd = @([UInt32]$Member) + } + else { + $membersToAdd += [UInt32[]]$Member + } + $payload = $membersToAdd -join ', ' + $body = "[$payload]" + } + + # WebAPI accepts a maximum of 100 accounts. Thus we send a request and reset the `membersToAdd` + # in order to accept more members + if ($membersToAdd.Length -eq 100) { + Invoke-TeamViewerRestMethodInternal + $membersToAdd = @() + } + } + + End { + # A request needs to be sent if there were less than 100 members + if ($membersToAdd.Length -gt 0) { + Invoke-TeamViewerRestMethodInternal + } + } +} + + + +function Connect-TeamViewerApi { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken + ) + + if (Invoke-TeamViewerPing -ApiToken $ApiToken) { + $global:PSDefaultParameterValues["*-Teamviewer*:ApiToken"] = $ApiToken + } +} + + +function Disconnect-TeamViewerApi { + $global:PSDefaultParameterValues.Remove("*-Teamviewer*:ApiToken") +} + + +function Export-TeamViewerSystemInformation { + param( + [Parameter(ValueFromPipeline = $true)] + [string] + $TargetDirectory + ) + Process { + if (Test-TeamViewerInstallation ) { + if (Get-OperatingSystem -eq 'Windows') { + $Temp = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.Guid]::NewGuid().ToString()) + $CurrentDirectory = Get-Location + $Temp | Get-TSCDirectoryFile + $Temp | Get-InstalledSoftware + $Temp | Get-IpConfig + $Temp | Get-MSInfo32 + $Temp | Get-HostFile + $Temp | Get-NSLookUpData + $Temp | Get-RouteTable + $Temp | Get-RegistryPath + $ClientID = Get-ClientId + $ZipFileName = 'TV_SC_' + $ClientID + '_WINPS.zip' + $ZipPath = Join-Path -Path "$Temp\Data" -ChildPath $ZipFileName + Compress-Archive -Path $Temp\* -DestinationPath $ZipPath -Force + if ($TargetDirectory -and (Test-Path $TargetDirectory)) { + Copy-Item -Path $ZipPath -Destination $TargetDirectory -Force + } + else { + Copy-Item -Path $ZipPath -Destination $CurrentDirectory -Force + } + } + else { + Write-Error 'Currently this functionality is supported only on Windows.' + } + } + else { + Write-Error 'TeamViewer is not installed.' + } + } +} + + + +function Get-TeamViewerAccount { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/account" + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response | ConvertTo-TeamViewerAccount) +} + + + +function Get-TeamViewerConnectionReport { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $false)] + [string] + $UserName, + + [Parameter(Mandatory = $false)] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [Alias("User")] + [object] + $UserId, + + [Parameter(Mandatory = $false)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("Group")] + [object] + $GroupId, + + [Parameter(Mandatory = $false)] + [string] + $DeviceName, + + [Parameter(Mandatory = $false)] + [int] + $DeviceId, + + [Parameter(Mandatory = $false)] + [switch] + $WithSessionCode, + + [Parameter(Mandatory = $false)] + [switch] + $WithoutSessionCode, + + [Parameter(Mandatory = $false)] + [string] + $SessionCode, + + [Parameter(Mandatory = $false)] + [TeamViewerConnectionReportSessionType] + $SupportSessionType, + + [Parameter(Mandatory = $true, ParameterSetName = "AbsoluteDates")] + [DateTime] + $StartDate, + + [Parameter(Mandatory = $false, ParameterSetName = "AbsoluteDates")] + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [DateTime] + $EndDate = (Get-Date), + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 12)] + [int] + $Months, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 31)] + [int] + $Days, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 24)] + [int] + $Hours, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 60)] + [int] + $Minutes, + + [Parameter(Mandatory = $false)] + [ValidateRange(1, [int]::MaxValue)] + [int] + $Limit + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/reports/connections"; + + $parameters = @{} + + if ($PSCmdlet.ParameterSetName -Eq 'RelativeDates') { + $StartDate = $EndDate.AddMonths(-1 * $Months).AddDays(-1 * $Days).AddHours(-1 * $Hours).AddMinutes(-1 * $Minutes) + } + if ($StartDate -And $EndDate -And $StartDate -lt $EndDate) { + $parameters.from_date = $StartDate.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + $parameters.to_date = $EndDate.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + } + + if ($UserName) { + $parameters.username = $UserName + } + + if ($UserId) { + $parameters.userid = $UserId | Resolve-TeamViewerUserId + } + + if ($DeviceName) { + $parameters.devicename = $DeviceName + } + + if ($DeviceId) { + $parameters.deviceid = $DeviceId + } + + if ($GroupId) { + $parameters.groupid = $GroupId | Resolve-TeamViewerGroupId + } + + if ($WithSessionCode -And !$WithoutSessionCode) { + $parameters.has_code = $true + } + elseif ($WithoutSessionCode -And !$WithSessionCode) { + $parameters.has_code = $false + } + + if ($SessionCode) { + $parameters.session_code = $SessionCode + } + + if ($SupportSessionType) { + $parameters.support_session_type = [int]$SupportSessionType + } + + $remaining = $Limit + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + $results = ($response.records | ConvertTo-TeamViewerConnectionReport) + if ($Limit) { + Write-Output ($results | Select-Object -First $remaining) + $remaining = $remaining - @($results).Count + } + else { + Write-Output $results + } + $parameters.offset_id = $response.next_offset + } while ($parameters.offset_id -And (!$Limit -Or $remaining -gt 0)) +} + + + +function Get-TeamViewerContact { + [CmdletBinding(DefaultParameterSetName = "FilteredList")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByContactId")] + [ValidateScript( { $_ | Resolve-TeamViewerContactId } )] + [Alias("ContactId")] + [string] + $Id, + + [Parameter(ParameterSetName = "FilteredList")] + [Alias("PartialName")] + [string] + $Name, + + [Parameter(ParameterSetName = "FilteredList")] + [ValidateSet('Online', 'Busy', 'Away', 'Offline')] + [string] + $FilterOnlineState, + + [Parameter(ParameterSetName = "FilteredList")] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/contacts"; + $parameters = @{ } + + switch ($PsCmdlet.ParameterSetName) { + 'ByContactId' { + $resourceUri += "/$Id" + $parameters = $null + } + 'FilteredList' { + if ($Name) { + $parameters['name'] = $Name + } + if ($FilterOnlineState) { + $parameters['online_state'] = $FilterOnlineState.ToLower() + } + if ($Group) { + $groupId = $Group | Resolve-TeamViewerGroupId + $parameters['groupid'] = $groupId + } + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + Write-Output ($response.contacts | ConvertTo-TeamViewerContact) +} + + + +function Get-TeamViewerCustomModuleId { + + if (Test-TeamViewerinstallation) { + $fileName = 'TeamViewer.json' + $installationDirectory = Get-TeamViewerInstallationDirectory + $filePath = Join-Path -Path $installationDirectory -ChildPath $fileName + if (Test-Path -Path $filePath) { + $jsonContent = Get-Content -Path $FilePath -Raw + $jsonObject = ConvertFrom-Json $jsonContent + if ($jsonObject.id) { + return $jsonObject.id + } + } + else { + Write-Error 'Custom module Id cannot be found. Check if customization is applied.' + } + } + else { + Write-Error 'TeamViewer is not installed' + } + +} + + + +function Get-TeamViewerDevice { + [CmdletBinding(DefaultParameterSetName = "FilteredList")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByDeviceId")] + [ValidateScript( { $_ | Resolve-TeamViewerDeviceId } )] + [Alias("DeviceId")] + [string] + $Id, + + [Parameter(ParameterSetName = "FilteredList")] + [int] + $TeamViewerId, + + [Parameter(ParameterSetName = "FilteredList")] + [ValidateSet('Online', 'Busy', 'Away', 'Offline')] + [string] + $FilterOnlineState, + + [Parameter(ParameterSetName = "FilteredList")] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/devices"; + $parameters = @{ } + + switch ($PsCmdlet.ParameterSetName) { + 'ByDeviceId' { + $resourceUri += "/$Id" + $parameters = $null + } + 'FilteredList' { + if ($TeamViewerId) { + $parameters['remotecontrol_id'] = "r$TeamViewerId" + } + if ($FilterOnlineState) { + $parameters['online_state'] = $FilterOnlineState.ToLower() + } + if ($Group) { + $groupId = $Group | Resolve-TeamViewerGroupId + $parameters['groupid'] = $groupId + } + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + Write-Output ($response.devices | ConvertTo-TeamViewerDevice) +} + + + +function Get-TeamViewerEventLog { + [CmdletBinding(DefaultParameterSetName = "RelativeDates")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ParameterSetName = "AbsoluteDates")] + [DateTime] + $StartDate, + + [Parameter(Mandatory = $false, ParameterSetName = "AbsoluteDates")] + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [DateTime] + $EndDate = (Get-Date), + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 12)] + [int] + $Months, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 31)] + [int] + $Days, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 24)] + [int] + $Hours, + + [Parameter(Mandatory = $false, ParameterSetName = "RelativeDates")] + [ValidateRange(0, 60)] + [int] + $Minutes, + + [Parameter(Mandatory = $false)] + [int] + $Limit, + + [Parameter(Mandatory = $false)] + [ArgumentCompleter( { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + $null = @($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + @( + 'AddRemoteWorkerDevice', + 'ChangedDisabledRemoteInput', + 'ChangedShowBlackScreen', + 'CompanyAddressBookDisabled', + 'CompanyAddressBookEnabled', + 'CompanyAddressBookMembersHid', + 'CompanyAddressBookMembersUnhid' + 'ConditionalAccessBlockMeetingStateChanged', + 'ConditionalAccessDirectoryGroupAdded', + 'ConditionalAccessDirectoryGroupDeleted', + 'ConditionalAccessDirectoryGroupMembersAdded', + 'ConditionalAccessDirectoryGroupMembersDeleted', + 'ConditionalAccessRuleAdded', + 'ConditionalAccessRuleDeleted', + 'ConditionalAccessRuleModified', + 'ConditionalAccessRuleVerificationStateChanged', + 'CreateCustomHost', + 'DeleteCustomHost', + 'EditOwnProfile', + 'EditTFAUsage', + 'EditUserPermissions', + 'EditUserProperties', + 'EmailConfirmed', + 'EndedRecording', + 'EndedSession', + 'GroupAdded', + 'GroupDeleted', + 'GroupShared', + 'GroupUpdated', + 'IncomingSession', + 'JoinCompany', + 'JoinedSession', + 'LeftSession', + 'ParticipantJoinedSession', + 'ParticipantLeftSession', + 'PausedRecording', + 'PolicyAdded', + 'PolicyDeleted', + 'PolicyUpdated', + 'ReceivedDisabledLocalInput', + 'ReceivedFile', + 'ReceivedShowBlackScreen', + 'RemoveRemoteWorkerDevice', + 'ResumedRecording', + 'ScriptTokenAdded', + 'ScriptTokenDeleted', + 'ScriptTokenUpdated', + 'SentFile', + 'StartedRecording', + 'StartedSession', + 'SwitchedSides', + 'UpdateCustomHost', + 'UserCreated', + 'UserDeleted', + 'UserGroupCreated', + 'UserGroupDeleted', + 'UserGroupMembersAdded', + 'UserGroupMembersRemoved', + 'UserGroupUpdated', + 'UserRemovedFromCompany' + ) | Where-Object { $_ -like "$wordToComplete*" } + } )] + [string[]] + $EventNames, + + [Parameter(Mandatory = $false)] + [ArgumentCompleter( { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + $null = @($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + @( + "CompanyAddressBook", + "CompanyAdministration", + "ConditionalAccess", + "CustomModules", + "GroupManagement", + "LicenseManagement", + "Policy", + "Session", + "UserGroups", + "UserProfile" + ) | Where-Object { $_ -like "$wordToComplete*" } + })] + [string[]] + $EventTypes, + + [Parameter(Mandatory = $false)] + [ValidateScript( { $_ | Resolve-TeamViewerUserEmail } )] + [Alias("Users")] + [object[]] + $AccountEmails, + + [Parameter(Mandatory = $false)] + [string] + $AffectedItem, + + [Parameter(Mandatory = $false)] + [Alias("RemoteControlSession")] + [guid] + $RemoteControlSessionId + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/EventLogging"; + + $Limit = if ($Limit -lt 0) { $null } else { $Limit } + + if ($PSCmdlet.ParameterSetName -Eq 'RelativeDates') { + $Hours = if (!$Months -And !$Days -And !$Hours -And !$Minutes) { 1 } else { $Hours } + $StartDate = $EndDate.AddMonths(-1 * $Months).AddDays(-1 * $Days).AddHours(-1 * $Hours).AddMinutes(-1 * $Minutes) + } + + $parameters = @{ + StartDate = $StartDate.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + EndDate = $EndDate.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + } + + if ($EventNames) { + $parameters.EventNames = $EventNames + } + if ($EventTypes) { + $parameters.EventTypes = $EventTypes + } + if ($AccountEmails) { + $parameters.AccountEmails = @($AccountEmails | Resolve-TeamViewerUserEmail) + } + if ($AffectedItem) { + $parameters.AffectedItem = $AffectedItem + } + if ($RemoteControlSessionId) { + $parameters.RCSessionGuid = $RemoteControlSessionId + } + + $remaining = $Limit + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($parameters | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + $results = ($response.AuditEvents | ConvertTo-TeamViewerAuditEvent) + if ($Limit) { + Write-Output ($results | Select-Object -First $remaining) + $remaining = $remaining - @($results).Count + } + else { + Write-Output $results + } + $parameters.ContinuationToken = $response.ContinuationToken + } while ($parameters.ContinuationToken -And (!$Limit -Or $remaining -gt 0)) +} + + + +function Get-TeamViewerGroup { + [CmdletBinding(DefaultParameterSetName = "FilteredList")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByGroupId")] + [Alias("GroupId")] + [string] + $Id, + + [Parameter(ParameterSetName = "FilteredList")] + [Alias("PartialName")] + [string] + $Name, + + [Parameter(ParameterSetName = "FilteredList")] + [ValidateSet('OnlyShared', 'OnlyNotShared')] + [string] + $FilterShared + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/groups"; + $parameters = @{ } + + switch ($PsCmdlet.ParameterSetName) { + 'ByGroupId' { + $resourceUri += "/$Id" + $parameters = $null + } + 'FilteredList' { + if ($Name) { + $parameters['name'] = $Name + } + switch ($FilterShared) { + 'OnlyShared' { $parameters['shared'] = $true } + 'OnlyNotShared' { $parameters['shared'] = $false } + } + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + if ($PsCmdlet.ParameterSetName -Eq 'ByGroupId') { + Write-Output ($response | ConvertTo-TeamViewerGroup) + } + else { + Write-Output ($response.groups | ConvertTo-TeamViewerGroup) + } +} + + + +function Get-TeamViewerId { + if (Test-TeamViewerInstallation) { + switch (Get-OperatingSystem) { + 'Windows' { + Write-Output (Get-ItemPropertyValue -Path (Get-TeamViewerRegKeyPath) -Name 'ClientID') + } + 'Linux' { + Write-Output (Get-TeamViewerLinuxGlobalConfig -Name 'ClientID') + } + } + } +} + + + +function Get-TeamViewerInstallationDirectory { + switch (Get-OperatingSystem) { + 'Windows' { + $regKey = Get-TeamViewerRegKeyPath + $installationDirectory = if (Test-Path $regKey) { + (Get-Item $regKey).GetValue('InstallationDirectory') + } + if ( + $installationDirectory -And ` + (Test-Path "$installationDirectory/TeamViewer.exe") + ) { + return $installationDirectory + } + } + 'Linux' { + if ( + (Test-Path '/opt/teamviewer/tv_bin/TeamViewer') + ) { + return '/opt/teamviewer/tv_bin/' + } + } + default { + Write-Error 'TeamViewer not installed' + } + } +} + + + + +function Get-TeamViewerLogFilePath { + param( + [switch] + $OpenFile + ) + + if (Test-TeamViewerInstallation) { + if (Get-OperatingSystem -eq 'Windows') { + $SearchDirectories = Get-TSCSearchDirectory + $LogFiles = New-Object System.Collections.ArrayList + foreach ($Name in $SearchDirectories.Keys) { + $SearchDirectory = $SearchDirectories[$Name] + foreach ($Folder in $SearchDirectory) { + if (Test-Path -Path $Folder) { + $files = Get-ChildItem -Path $Folder -File -Recurse + foreach ($file in $files) { + if ($file.Name.EndsWith('.log')) { + $LogFiles.add($file.FullName) | Out-Null + } + } + } + } + } + + if ($OpenFile) { + $LogFile = $host.ui.PromptForChoice('Select file', 'Choose file:', ` + @($LogFiles), 0) + Invoke-Item -Path $LogFiles[$LogFile] + } + else { + return $LogFiles + } + } + } + else { + Write-Error 'TeamViewer is not installed.' + } +} + + + +function Get-TeamViewerManagedDevice { + [CmdletBinding(DefaultParameterSetName = "List")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByDeviceId")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [Alias("Device")] + [guid] + $Id, + + [Parameter(Mandatory = $true, ParameterSetName = "ListGroup")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(ParameterSetName = "ListGroup")] + [switch] + $Pending + ) + + # default is 'List': + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices"; + $parameters = @{ } + $isListOperation = $true + + switch ($PsCmdlet.ParameterSetName) { + 'ByDeviceId' { + $resourceUri += "/$Id" + $parameters = $null + $isListOperation = $false + } + 'ListGroup' { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/$(if ($Pending) { "pending-" })devices" + } + } + + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + if ($PsCmdlet.ParameterSetName -Eq 'ByDeviceId') { + Write-Output ($response | ConvertTo-TeamViewerManagedDevice) + } + else { + $parameters.paginationToken = $response.nextPaginationToken + Write-Output ($response.resources | ConvertTo-TeamViewerManagedDevice) + } + } while ($isListOperation -And $parameters.paginationToken) +} + + + +function Get-TeamViewerManagedGroup { + [CmdletBinding(DefaultParameterSetName = "List")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByGroupId")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } ) ] + [Alias("GroupId")] + [guid] + $Id, + + [Parameter(ParameterSetName = "ByDeviceId")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups" + $parameters = @{ } + + switch ($PsCmdlet.ParameterSetName) { + 'ByGroupId' { + $resourceUri += "/$Id" + $parameters = $null + } + 'ByDeviceId' { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/groups" + } + } + + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + if ($PsCmdlet.ParameterSetName -Eq 'ByGroupId') { + Write-Output ($response | ConvertTo-TeamViewerManagedGroup) + } + else { + $parameters.paginationToken = $response.nextPaginationToken + Write-Output ($response.resources | ConvertTo-TeamViewerManagedGroup) + } + } while ($PsCmdlet.ParameterSetName -In @('List', 'ByDeviceId') ` + -And $parameters.paginationToken) +} + + + +function Get-TeamViewerManagementId { + if (Test-TeamViewerInstallation) { + switch (Get-OperatingSystem) { + 'Windows' { + $regKeyPath = Join-Path (Get-TeamViewerRegKeyPath) 'DeviceManagementV2' + $regKey = if (Test-Path -LiteralPath $regKeyPath) { Get-Item -Path $regKeyPath } + if ($regKey) { + $unmanaged = [bool]($regKey.GetValue('Unmanaged')) + $managementId = $regKey.GetValue('ManagementId') + } + } + 'Linux' { + $unmanaged = [bool](Get-TeamViewerLinuxGlobalConfig -Name 'DeviceManagementV2\Unmanaged') + $managementId = Get-TeamViewerLinuxGlobalConfig -Name 'DeviceManagementV2\ManagementId' + } + } + if (!$unmanaged -And $managementId) { + Write-Output ([guid]$managementId) + } + } +} + + + +function Get-TeamViewerManager { + [CmdletBinding(DefaultParameterSetName = "ByDeviceId")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ParameterSetName = "ByDeviceId")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(Mandatory = $true, ParameterSetName = "ByGroupId")] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [object] + $Group + ) + + $resourceUri = $null + switch ($PsCmdlet.ParameterSetName) { + 'ByDeviceId' { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/managers" + } + 'ByGroupId' { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/managers" + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + switch ($PsCmdlet.ParameterSetName) { + 'ByDeviceId' { + Write-Output ($response.resources | ConvertTo-TeamViewerManager -DeviceId $deviceId) + } + 'ByGroupId' { + Write-Output ($response.resources | ConvertTo-TeamViewerManager -GroupId $groupId) + } + } +} + + + +function Get-TeamViewerPolicy { + [CmdletBinding(DefaultParameterSetName = "FilteredList")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByPolicyId")] + [Alias("PolicyId")] + [guid] + $Id + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/teamviewerpolicies"; + $parameters = @{ } + + switch ($PsCmdlet.ParameterSetName) { + 'ByPolicyId' { + $resourceUri += "/$Id" + $parameters = $null + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + Write-Output ($response.policies | ConvertTo-TeamViewerPolicy) +} + + + + +function Get-TeamViewerRoleAssignmentToAccount { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRole')] + [string] + $UserRoleId + ) + + + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/assignments/account?userRoleId=$UserRoleId" + $parameters = $null + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + if ($response.ContinuationToken) { + $resourceUri += '&continuationToken=' + $response.ContinuationToken + } + Write-Output ($response.AssignedToUsers | ConvertTo-TeamViewerRoleAssignedUser ) + }while ($response.ContinuationToken) +} + + + +function Get-TeamViewerRoleAssignmentToUserGroup { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript({ $_ | Resolve-TeamviewerUserRoleId })] + [Alias('UserRole')] + [string] + $UserRoleId + ) + + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/assignments/usergroups?userRoleId=$UserRoleId" + $parameters = $null + } + Process { + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + if ($response.ContinuationToken) { + $resourceUri += "&continuationToken=" + $response.ContinuationToken + } + Write-Output ($response.AssignedToGroups | ConvertTo-TeamViewerRoleAssignedUserGroup ) + }while ($response.ContinuationToken) + } +} + + + +function Get-TeamViewerService { + switch (Get-OperatingSystem) { + 'Windows' { + Get-Service -Name (Get-TeamViewerServiceName) + } + 'Linux' { + Invoke-ExternalCommand /opt/teamviewer/tv_bin/script/teamviewer daemon status + } + } +} + + + +function Get-TeamViewerSsoDomain { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/ssoDomain"; + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response.domains | ConvertTo-TeamViewerSsoDomain) +} + + + +function Get-TeamViewerSsoExclusion { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerSsoDomainId } )] + [Alias("Domain")] + [object] + $DomainId + ) + + $id = $DomainId | Resolve-TeamViewerSsoDomainId + $resourceUri = "$(Get-TeamViewerApiUri)/ssoDomain/$id/exclusion"; + $parameters = @{ } + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + Write-Output $response.emails + $parameters.ct = $response.continuation_token + } while ($parameters.ct) +} + + + +function Get-TeamViewerUser { + [CmdletBinding(DefaultParameterSetName = "FilteredList")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = "ByUserId")] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [Alias("UserId")] + [string] + $Id, + + [Parameter(ParameterSetName = "FilteredList")] + [Alias("PartialName")] + [string] + $Name, + + [Parameter(ParameterSetName = "FilteredList")] + [string[]] + $Email, + + [Parameter(ParameterSetName = "FilteredList")] + [string[]] + $Permissions, + + [Parameter()] + [ValidateSet("All", "Minimal")] + $PropertiesToLoad = "All" + ) + + $parameters = @{ } + switch ($PropertiesToLoad) { + "All" { $parameters.full_list = $true } + "Minimal" { } + } + + $resourceUri = "$(Get-TeamViewerApiUri)/users" + + switch ($PsCmdlet.ParameterSetName) { + "ByUserId" { + $resourceUri += "/$Id" + $parameters = $null + } + "FilteredList" { + if ($Name) { + $parameters['name'] = $Name + } + if ($Email) { + $parameters['email'] = ($Email -join ',') + } + if ($Permissions) { + $parameters['permissions'] = ($Permissions -join ',') + } + } + } + + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + if ($PsCmdlet.ParameterSetName -Eq "ByUserId") { + Write-Output ($response | ConvertTo-TeamViewerUser -PropertiesToLoad $PropertiesToLoad) + } + else { + Write-Output ($response.users | ConvertTo-TeamViewerUser -PropertiesToLoad $PropertiesToLoad) + } +} + + + +function Get-TeamViewerUserGroup { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter()] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias("UserGroupId")] + [Alias("Id")] + [object] + $UserGroup + ) + + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups" + $parameters = @{ } + $isListOperation = $true + + if ($UserGroup) { + $GroupId = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri += "/$GroupId" + $parameters = $null + $isListOperation = $false + } + } + + Process { + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + if ($UserGroup) { + Write-Output ($response | ConvertTo-TeamViewerUserGroup) + } + else { + $parameters.paginationToken = $response.nextPaginationToken + Write-Output ($response.resources | ConvertTo-TeamViewerUserGroup) + } + } while ($isListOperation -And $parameters.paginationToken) + } +} + + + +function Get-TeamViewerUserGroupMember { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias("UserGroupId")] + [Alias("Id")] + [object] + $UserGroup + ) + + Begin { + $id = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups/$id/members" + $parameters = @{ } + } + + Process { + do { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + $parameters.paginationToken = $response.nextPaginationToken + Write-Output ($response.resources | ConvertTo-TeamViewerUserGroupMember) + } while ($parameters.paginationToken) + } +} + + + +function Get-TeamViewerUserRole { + [CmdletBinding(DefaultParameterSetName = '')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken + ) + + Begin{ + $parameters = @{ } + $resourceUri = "$(Get-TeamViewerApiUri)/userroles" + } + +Process{ + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -Body $parameters ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response.Roles | ConvertTo-TeamViewerUserRole ) +} +} + + + +function Get-TeamViewerVersion { + if (Test-TeamViewerInstallation) { + switch (Get-OperatingSystem) { + 'Windows' { + return (Get-ItemPropertyValue -Path (Get-TeamViewerRegKeyPath) -Name 'Version') + } + 'Linux' { + return (Get-TeamViewerLinuxGlobalConfig -Name 'Version') + } + } + } +} + + + +function Invoke-TeamViewerPackageDownload { + Param( + [Parameter()] + [ValidateSet('Full', 'Host', 'MSI32', 'MSI64', 'Portable', 'QuickJoin', 'QuickSupport', 'Full64Bit')] + [ValidateScript( { + if (($_ -ne 'Full') -And ((Get-OperatingSystem) -ne 'Windows')) { + $PSCmdlet.ThrowTerminatingError( + ("PackageType parameter is only supported on Windows platforms" | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + $true + })] + [string] + $PackageType, + + [Parameter()] + [ValidateScript( { + if ((Get-OperatingSystem) -ne 'Windows') { + $PSCmdlet.ThrowTerminatingError( + ("MajorVersion parameter is only supported on Windows platforms" | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + if($PackageType -eq 'MSI32' -or 'MSI64' ){ + $PSCmdlet.ThrowTerminatingError( + ("MajorVersion parameter is not supported for MSI packages" | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + if ($_ -lt 14) { + $PSCmdlet.ThrowTerminatingError( + ("Unsupported TeamViewer version $_" | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + $true + } )] + [int] + $MajorVersion, + + [Parameter()] + [string] + $TargetDirectory = (Get-Location).Path, + + [Parameter()] + [switch] + $Force + ) + + if ((-not $PackageType) -And ((Get-OperatingSystem) -eq 'Windows')) { + $Package = $host.ui.PromptForChoice('Select Package Type', 'Choose a package type:', ` + @('Full', 'Host', 'MSI32', 'MSI64', 'Portable', 'QuickJoin', 'QuickSupport', 'Full64Bit'), 0) + $PackageType = @('Full', 'Host', 'MSI32', 'MSI64', 'Portable', 'QuickJoin', 'QuickSupport', 'Full64Bit')[$Package] + } + + $additionalPath = '' + switch (Get-OperatingSystem) { + 'Windows' { + $filename = switch ($PackageType) { + 'Full' { 'TeamViewer_Setup.exe' } + 'MSI32' { 'TeamViewer_MSI32.zip' } + 'MSI64' { 'TeamViewer_MSI64.zip' } + 'Host' { 'TeamViewer_Host_Setup.exe' } + 'Portable' { 'TeamViewerPortable.zip' } + 'QuickJoin' { 'TeamViewerQJ.exe' } + 'QuickSupport' { 'TeamViewerQS.exe' } + 'Full64Bit' { 'TeamViewer_Setup_x64.exe' } + } + if ($MajorVersion) { + $additionalPath = "/version_$($MajorVersion)x" + } + if(($PackageType -eq 'MSI32' -or 'MSI64' )){ + $additionalPath = '/version_15x' + } + } + 'Linux' { + $releaseInfo = (Get-Content /etc/*-release) + $filename = switch -Regex ($releaseInfo) { + 'debian|ubuntu' { + $platform = if ([Environment]::Is64BitOperatingSystem) { 'amd64' } else { 'i386' } + "teamviewer_$platform.deb" + } + 'centos|rhel|fedora' { + $platform = if ([Environment]::Is64BitOperatingSystem) { 'x86_64' } else { 'i686' } + "teamviewer.$platform.rpm" + } + 'suse|opensuse' { + $platform = if ([Environment]::Is64BitOperatingSystem) { 'x86_64' } else { 'i686' } + "teamviewer-suse.$platform.rpm" + } + } + $filename = $filename | Select-Object -First 1 + $additionalPath = '/linux' + } + } + + $downloadUrl = "https://dl.teamviewer.com/download$additionalPath/$filename" + $targetFile = Join-Path $TargetDirectory $filename + + if ((Test-Path $targetFile) -And -Not $Force -And ` + -Not $PSCmdlet.ShouldContinue("File $targetFile already exists. Override?", "Override existing file?")) { + return + } + + Write-Verbose "Downloading $downloadUrl to $targetFile" + $client = New-Object System.Net.WebClient + $client.DownloadFile($downloadUrl, $targetFile) + Write-Output $targetFile +} + + + +function Invoke-TeamViewerPing { + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken + ) + + $resourceUri = "$(Get-TeamViewerApiUri)/ping" + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Get ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output $result.token_valid +} + + + +function New-TeamViewerContact { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [Alias('EmailAddress')] + [string] + $Email, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter()] + [switch] + $Invite + ) + + $body = @{ + email = $Email + groupid = $Group | Resolve-TeamViewerGroupId + } + if ($Invite) { + $body['invite'] = $true + } + + $resourceUri = "$(Get-TeamViewerApiUri)/contacts" + if ($PSCmdlet.ShouldProcess($Email, "Create contact")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + $result = ($response | ConvertTo-TeamViewerContact) + Write-Output $result + } +} + + + +function New-TeamViewerDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [int] + $TeamViewerId, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter()] + [Alias("Alias")] + [string] + $Name, + + [Parameter()] + [string] + $Description, + + [Parameter()] + [securestring] + $Password + ) + + $body = @{ + remotecontrol_id = "r$TeamViewerId" + groupid = $Group | Resolve-TeamViewerGroupId + } + + if ($Name) { + $body['alias'] = $Name + } + if ($Description) { + $body['description'] = $Description + } + if ($Password) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password) + $body['password'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + + $resourceUri = "$(Get-TeamViewerApiUri)/devices" + if ($PSCmdlet.ShouldProcess($TeamViewerId, "Create device entry")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + $result = ($response | ConvertTo-TeamViewerDevice) + Write-Output $result + } +} + + + +function New-TeamViewerGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [string] + $Name, + + [Parameter()] + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId } )] + [Alias("PolicyId")] + [object] + $Policy + ) + + $body = @{ name = $Name } + if ($Policy) { + $body["policy_id"] = $Policy | Resolve-TeamViewerPolicyId + } + + $resourceUri = "$(Get-TeamViewerApiUri)/groups" + if ($PSCmdlet.ShouldProcess($Name, "Create group")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response | ConvertTo-TeamViewerGroup) + } +} + + + +function New-TeamViewerManagedGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [string] + $Name + ) + + $body = @{ name = $Name } + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups" + if ($PSCmdlet.ShouldProcess($Name, "Create managed group")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response | ConvertTo-TeamViewerManagedGroup) + } +} + + + +function New-TeamViewerPolicy { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [string] + $Name, + + [Parameter()] + [AllowEmptyCollection()] + [object[]] + $Settings, + + [Parameter()] + [switch] + $DefaultPolicy = $False + ) + + $body = @{ + name = $Name + default = [boolean]$DefaultPolicy + settings = @() + } + + if ($Settings) { + $body.settings = @($Settings) + } + + $resourceUri = "$(Get-TeamViewerApiUri)/teamviewerpolicies" + if ($PSCmdlet.ShouldProcess($Name, "Create policy")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function New-TeamViewerUser { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "WithPassword")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [Alias('EmailAddress')] + [string] + $Email, + + [Parameter(Mandatory = $true)] + [Alias('DisplayName')] + [string] + $Name, + + [Parameter(Mandatory = $true, ParameterSetName = "WithPassword")] + [securestring] + $Password, + + [Parameter(ParameterSetName = "WithoutPassword")] + [Alias('NoPassword')] + [switch] + $WithoutPassword, + + [Parameter()] + [securestring] + $SsoCustomerIdentifier, + + [Parameter()] + [array] + $Permissions, + + [Parameter()] + [ValidateScript( { $_ | Resolve-TeamViewerLanguage } )] + [cultureinfo] + $Culture + ) + + if (-Not $Culture) { + try { $Culture = Get-Culture } + catch { $Culture = 'en' } + } + + $body = @{ + email = $Email + name = $Name + language = $Culture | Resolve-TeamViewerLanguage + permissions = $Permissions -join ',' + } + + if ($Password -And -Not $WithoutPassword) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password) + $body['password'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + + if ($SsoCustomerIdentifier) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SsoCustomerIdentifier) + $body['sso_customer_id'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + + $resourceUri = "$(Get-TeamViewerApiUri)/users" + if ($PSCmdlet.ShouldProcess("$Name <$Email>", "Create user")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + $result = ($response | ConvertTo-TeamViewerUser) + $result.Email = $Email + Write-Output $result + } +} + + + +function New-TeamViewerUserGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [string] + $Name + ) + + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups" + $body = @{ name = $Name } + } + + Process { + if ($PSCmdlet.ShouldProcess($Name, "Create user group")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response | ConvertTo-TeamViewerUserGroup) + } + } +} + + + + +function New-TeamViewerUserRole { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true )] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [Alias('UserRoleName')] + [string] + $Name, + + [Parameter(Mandatory = $false)] + [AllowEmptyCollection()] + [object[]] + $Permissions + ) + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/userroles" + $body = @{ + Name = $Name + Permissions = @() + } + + if ($Permissions) { + $body.Permissions = @($Permissions) + } + } + + Process { + if ($PSCmdlet.ShouldProcess($Name, 'Create User Role')) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + $result = ($response.Role | ConvertTo-TeamViewerUserRole) + Write-Output $result + } + } + +} + + + +function Publish-TeamViewerGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [Alias("UserId")] + [object[]] + $User, + + [Parameter()] + [ValidateSet("read", "readwrite")] + $Permissions = "read" + ) + + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Permissions + + $groupId = $Group | Resolve-TeamViewerGroupId + $userIds = $User | Resolve-TeamViewerUserId + $resourceUri = "$(Get-TeamViewerApiUri)/groups/$groupId/share_group" + $body = @{ + users = @($userIds | ForEach-Object { @{ + userid = $_ + permissions = $Permissions + } }) + } + + if ($PSCmdlet.ShouldProcess($userids, "Add group share")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function Remove-TeamViewerAssignment { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + + if (Test-TeamViewerInstallation) { + $OS = Get-OperatingSystem + $CurrentDirectory = Get-Location + $installationDirectory = Get-TeamViewerInstallationDirectory + Set-Location $installationDirectory + if ($OS -eq 'Windows') { + $cmd = 'unassign' + $FilePath = 'TeamViewer.exe' + } + elseif ($OS -eq 'Linux') { + $cmd = 'teamviewer unassign' + $FilePath = 'sudo' + } + $process = Start-Process -FilePath $FilePath -ArgumentList $cmd -Wait -PassThru + $process.ExitCode | Resolve-AssignmentErrorCode + Set-Location $CurrentDirectory + } + else { + Write-Output 'TeamViewer is not installed.' + } +} + + + + + +function Remove-TeamViewerContact { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerContactId } )] + [Alias("ContactId")] + [Alias("Id")] + [object] + $Contact + ) + Process { + $contactId = $Contact | Resolve-TeamViewerContactId + $resourceUri = "$(Get-TeamViewerApiUri)/contacts/$contactId" + if ($PSCmdlet.ShouldProcess($contactId, "Remove contact")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerCustomization { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + if (Get-OperatingSystem -eq 'Windows') { + if (Test-TeamViewerInstallation) { + $installationDirectory = Get-TeamViewerInstallationDirectory + $currentDirectory = Get-Location + Set-Location $installationDirectory + $cmd = 'customize --remove' + $process = Start-Process -FilePath TeamViewer.exe -ArgumentList $cmd -Wait -PassThru + $process.ExitCode | Resolve-CustomizationErrorCode + Set-Location $currentDirectory + } + else { + Write-Error 'TeamViewer is not installed' + } + } + else { + Write-Error 'Customization is currently supported only on Windows.' + } +} + + + +function Remove-TeamViewerDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerDeviceId } )] + [Alias("DeviceId")] + [Alias("Id")] + [object] + $Device + ) + Process { + $deviceId = $Device | Resolve-TeamViewerDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/devices/$deviceId" + if ($PSCmdlet.ShouldProcess($deviceId, "Remove device entry")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [Alias("Id")] + [object] + $Group + ) + Process { + $groupId = $Group | Resolve-TeamViewerGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/groups/$groupId" + + if ($PSCmdlet.ShouldProcess($groupId, "Remove group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerManagedDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [object] + $Group + ) + Process { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $groupId = $Group | Resolve-TeamViewerManagedGroupId + + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/devices/$deviceId" + + if ($PSCmdlet.ShouldProcess($deviceId, "Remove device from managed group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerManagedDeviceManagement { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias('DeviceId')] + [object] + $Device + ) + Process { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId" + + if ($PSCmdlet.ShouldProcess($deviceId, 'Remove Management from a device (clears all managers and groups)')) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerManagedGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("GroupId")] + [Alias("Id")] + [object] + $Group + ) + Process { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId" + + if ($PSCmdlet.ShouldProcess($groupId, "Remove managed group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerManager { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "ByDeviceId")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { + if (($_.PSObject.TypeNames -contains 'TeamViewerPS.Manager') -And -Not $_.GroupId -And -Not $_.DeviceId) { + $PSCmdlet.ThrowTerminatingError( + ("Invalid manager object. Manager must be a group or device manager." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + $_ | Resolve-TeamViewerManagerId + })] + [Alias("ManagerId")] + [Alias("Id")] + [object] + $Manager, + + [Parameter(ParameterSetName = 'ByDeviceId')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(ParameterSetName = 'ByGroupId')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId })] + [Alias("GroupId")] + [object] + $Group + ) + Process { + $deviceId = $null + $groupId = $null + if ($Manager.PSObject.TypeNames -contains 'TeamViewerPS.Manager') { + if ($Device -Or $Group) { + $PSCmdlet.ThrowTerminatingError( + ("Device or Group parameter must not be specified if a [TeamViewerPS.Manager] object is given." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + if ($Manager.DeviceId) { + $deviceId = $Manager.DeviceId + } + elseif ($Manager.GroupId) { + $groupId = $Manager.GroupId + } + } + elseif ($Device) { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + } + elseif ($Group) { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + } + else { + $PSCmdlet.ThrowTerminatingError( + ("Device or Group parameter must be specified if no [TeamViewerPS.Manager] object is given." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $managerId = $Manager | Resolve-TeamViewerManagerId + if ($deviceId) { + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/managers/$managerId" + $processMessage = "Remove manager from managed device" + } + elseif ($groupId) { + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/managers/$managerId" + $processMessage = "Remove manager from managed group" + } + + if ($PSCmdlet.ShouldProcess($managerId, $processMessage)) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerPolicy { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId } )] + [Alias('PolicyId')] + [object] + $Policy + ) + Process { + $policyId = $Policy | Resolve-TeamViewerPolicyId + $resourceUri = "$(Get-TeamViewerApiUri)/teamviewerpolicies/$policyId" + + if ($PSCmdlet.ShouldProcess($policyId, "Delete policy")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamviewerPolicyFromManagedDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(Mandatory = $true)] + [PolicyType] + $PolicyType + ) + Begin { + $body = @{ + 'policy_type' = [int]$PolicyType + } + } + Process { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/policy/remove" + + if ($PSCmdlet.ShouldProcess($Device.ToString(), "Change managed device entry")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerPSProxy { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + $global:TeamViewerProxyUriRemoved = $true + $global:TeamViewerProxyUriRemoved | Out-Null # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + if($PSCmdlet.ShouldProcess($TeamViewerProxyUriRemoved,"Remove proxy for WebAPI")){ + $global:TeamViewerProxyUriSet = $null + $global:TeamViewerProxyUriSet | Out-Null # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + [Environment]::SetEnvironmentVariable('TeamViewerProxyUri','', 'User') + } +} + + + +function Remove-TeamViewerRoleFromAccount { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRole')] + [object] + $UserRoleId, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('Id', 'UserIds')] + [string[]] + $Accounts + ) + + Begin { + $id = $UserRoleId | Resolve-TeamViewerUserRoleId + $null = $ApiToken + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/unassign/account" + $AccountsToRemove = @() + $body = @{ + UserIds = @() + UserRoleId = $id + } + function Invoke-TeamViewerRestMethodInternal { + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($result) + } + + } + + Process { + if ($PSCmdlet.ShouldProcess($Accounts, 'Unassign Account from Role')) { + if (($Accounts -notmatch 'u[0-9]+') -and ($Accounts -match '[0-9]+')) { + $Accounts = $Accounts | ForEach-Object { $_.Insert(0, 'u') } + } + foreach ($Account in $Accounts) { + $AccountsToRemove += $Account + $body.UserIds = @($AccountsToRemove) + } + } + if ($AccountsToRemove.Length -eq 100) { + Invoke-TeamViewerRestMethodInternal + $AccountsToRemove = @() + } + } + End { + if ($AccountsToRemove.Length -gt 0) { + Invoke-TeamViewerRestMethodInternal + } + } +} + + + +function Remove-TeamViewerRoleFromUserGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias('UserGroupId')] + [Alias('Id')] + [object] + $UserGroup + ) + + Begin { + $null = $ApiToken + $resourceUri = "$(Get-TeamViewerApiUri)/userroles/unassign/usergroup" + $body = @{ + UserGroupId = $UserGroup + } + } + + + Process { + if ($PSCmdlet.ShouldProcess($UserGroupId, 'Unassign Role from User Group')) { + $result = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($result) + } + } +} + + + +function Remove-TeamViewerSsoExclusion { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerSsoDomainId } )] + [Alias("Domain")] + [object] + $DomainId, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [string[]] + $Email + ) + Begin { + $id = $DomainId | Resolve-TeamViewerSsoDomainId + $resourceUri = "$(Get-TeamViewerApiUri)/ssoDomain/$id/exclusion" + $emailsToRemove = @() + $null = $ApiToken # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + + function Invoke-RequestInternal { + $body = @{ + emails = @($emailsToRemove) + } + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } + Process { + if ($PSCmdlet.ShouldProcess($Email, "Remove SSO exclusion")) { + $emailsToRemove += $Email + } + if ($emailsToRemove.Length -eq 100) { + Invoke-RequestInternal + $emailsToRemove = @() + } + } + End { + if ($emailsToRemove.Length -gt 0) { + Invoke-RequestInternal + } + } +} + + + +function Remove-TeamViewerUser { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [Alias("UserId")] + [Alias("Id")] + [object] + $User, + + [Parameter()] + [switch] + $Permanent + ) + Process { + $userId = $User | Resolve-TeamViewerUserId + $resourceUri = "$(Get-TeamViewerApiUri)/users/$userId" + + if ($Permanent) { + $resourceUri += '?isPermanentDelete=true' + } + + if ($PSCmdlet.ShouldProcess($userId, "Remove user")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerUserGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias("UserGroupId")] + [Alias("Id")] + [object] + $UserGroup + ) + + Begin { + $id = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups/$id" + } + + Process { + if ($PSCmdlet.ShouldProcess($UserGroup.ToString(), "Remove user group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Remove-TeamViewerUserGroupMember { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByUserGroupMemberId')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias('UserGroupId')] + [Alias('Id')] + [object] + $UserGroup, + + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupMemberMemberId } )] + [Alias('UserGroupMemberId')] + [Alias('MemberId')] + [Alias('UserId')] + [Alias('User')] + [object[]] + $UserGroupMember + ) + + Begin { + $id = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups/$id/members" + $membersToRemove = @() + $null = $ApiToken # https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $UserGroupMember + function Invoke-TeamViewerRestMethodInternal { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + + function Get-MemberId { + switch ($UserGroupMember) { + { $UserGroupMember[0].PSObject.TypeNames -contains 'TeamViewerPS.UserGroupMember' } { + $UserGroupMember = $UserGroupMember | Resolve-TeamViewerUserGroupMemberMemberId + return $UserGroupMember + } + Default { + if ($UserGroupMember -notmatch 'u[0-9]+') { + ForEach-Object { + $UserGroupMember = [int[]]$UserGroupMember + } + } + else { + ForEach-Object { + $UserGroupMember = [int[]]$UserGroupMember.trim('u') + } + } + return $UserGroupMember + } + } + } + } + + Process { + # when members are provided as pipeline input, each member is provided as separate statement, + # thus the members should be combined to one array in order to send a single request + if ($PSCmdlet.ShouldProcess((Get-MemberId), 'Remove user group member')) { + if (Get-MemberId -isnot [array]) { + $membersToRemove += @(Get-MemberId) + } + else { + $membersToRemove += Get-MemberId + } + $payload = $membersToRemove -join ', ' + $body = "[$payload]" + } + + # WebAPI accepts max 100 accounts. Thus we send a request, and reset the `membersToRemove` + # in order to accept more members + if ($membersToRemove.Length -eq 100) { + Invoke-TeamViewerRestMethodInternal + $membersToRemove = @() + } + } + + End { + # A request needs to be send if there were less than 100 members + if ($membersToRemove.Length -gt 0) { + Invoke-TeamViewerRestMethodInternal + } + } +} + + + +function Remove-TeamViewerUserRole { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRole')] + [Alias('Id')] + [object] + $UserRoleId + ) + + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/userroles?userRoleId=$UserRoleId" + } + + Process { + if ($PSCmdlet.ShouldProcess($UserRoleId.ToString(), 'Remove User Role')) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Delete ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Restart-TeamViewerService { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + if ($PSCmdlet.ShouldProcess('TeamViewer service')) { + switch (Get-OperatingSystem) { + 'Windows' { + Restart-Service -Name (Get-TeamViewerServiceName) + } + 'Linux' { + Invoke-ExternalCommand /opt/teamviewer/tv_bin/script/teamviewer daemon restart + } + } + } +} + + + +function Set-TeamViewerAccount { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(ParameterSetName = 'ByParameters')] + [Alias('DisplayName')] + [string] + $Name, + + [Parameter(ParameterSetName = 'ByParameters')] + [Alias('EmailAddress')] + [string] + $Email, + + [Parameter(ParameterSetName = 'ByParameters')] + [securestring] + $Password, + + [Parameter(ParameterSetName = 'ByParameters')] + [securestring] + $OldPassword, + + [Parameter(ParameterSetName = 'ByParameters')] + [ValidateScript( { $_ | Resolve-TeamViewerLanguage } )] + [object] + $EmailLanguage, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByProperties')] + [hashtable] + $Property + ) + + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Property + + $body = @{} + switch ($PSCmdlet.ParameterSetName) { + 'ByParameters' { + if ($Name) { + $body['name'] = $Name + } + if ($Email) { + $body['email'] = $Email + } + if ($Password) { + if (-Not $OldPassword) { + $PSCmdlet.ThrowTerminatingError( + ("Old password required when attempting to change account password." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password) + $body['password'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($OldPassword) + $body['oldpassword'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + if ($EmailLanguage) { + $body['email_language'] = $EmailLanguage | Resolve-TeamViewerLanguage + } + } + 'ByProperties' { + @('name', 'email', 'password', 'oldpassword', 'email_language') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the account." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $resourceUri = "$(Get-TeamViewerApiUri)/account" + + if ($PSCmdlet.ShouldProcess("TeamViewer account")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function Set-TeamViewerAPIUri { + [CmdletBinding(SupportsShouldProcess = $true)] + param ( + [Parameter(Mandatory = $false)] + [string]$NewUri, + [Parameter(Mandatory = $false)] + [bool]$Default + ) + + $config = [TeamViewerConfiguration]::GetInstance() + $PSDefaultParameterValues = @{'CmdletName:Default' = $true } + + if ($PSCmdlet.ShouldProcess('TeamViewer account')) { + if ($NewUri) { + $config.APIUri = $NewUri + Write-Output "TeamViewer API URL set to: $($config.APIUri)" + } + elseif ($Default) { + $config.APIUri = 'https://webapi.teamviewer.com/api/v1' + Write-Output "TeamViewer API URL set to: $($config.APIUri)" + } + } + +} + + + +function Set-TeamViewerDevice { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Default")] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerDeviceId } )] + [Alias("DeviceId")] + [Alias("Id")] + [object] + $Device, + + [Parameter(ParameterSetName = "ChangeGroup")] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(ParameterSetName = "ChangePolicy")] + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId -AllowInherit -AllowNone } )] + [Alias("PolicyId")] + [object] + $Policy, + + [Parameter()] + [Alias("Alias")] + [string] + $Name, + + [Parameter()] + [string] + $Description, + + [Parameter()] + [securestring] + $Password + ) + Begin { + $body = @{} + + if ($Name) { + $body['alias'] = $Name + } + if ($Description) { + $body['description'] = $Description + } + if ($Password) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password) + $body['password'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + if ($Group) { + $body['groupid'] = $Group | Resolve-TeamViewerGroupId + } + if ($Policy) { + $body['policy_id'] = $Policy | Resolve-TeamViewerPolicyId -AllowNone -AllowInherit + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the device." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + } + Process { + $deviceId = $Device | Resolve-TeamViewerDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/devices/$deviceId" + + if ($PSCmdlet.ShouldProcess($Device.ToString(), "Change device entry")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Set-TeamViewerGroup { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [Alias("Id")] + [object] + $Group, + + [Parameter(ParameterSetName = 'ByParameters')] + [string] + $Name, + + [Parameter(ParameterSetName = 'ByParameters')] + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId } )] + [Alias("PolicyId")] + [object] + $Policy, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByProperties')] + [hashtable] + $Property + ) + Begin { + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Property + + $body = @{} + switch ($PSCmdlet.ParameterSetName) { + 'ByParameters' { + $body['name'] = $Name + if ($Policy) { + $body['policy_id'] = $Policy | Resolve-TeamViewerPolicyId + } + } + 'ByProperties' { + @('name', 'policy_id') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the group." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + } + Process { + $groupId = $Group | Resolve-TeamViewerGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/groups/$groupId" + + if ($PSCmdlet.ShouldProcess($groupId, "Update group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Set-TeamViewerManagedDevice { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Alias("Alias")] + [string] + $Name, + + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId } )] + [Alias("PolicyId")] + [object] + $Policy, + + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId } )] + [Alias("ManagedGroupId")] + [object] + $ManagedGroup + ) + Begin { + $body = @{} + + if ($Name) { + $body['name'] = $Name + } + if ($Policy) { + $body['teamviewerPolicyId'] = $Policy | Resolve-TeamViewerPolicyId + } + elseif ($ManagedGroup) { + $body['managedGroupId'] = $ManagedGroup | Resolve-TeamViewerManagedGroupId + } + + if ($Policy -And $ManagedGroup) { + $PSCmdlet.ThrowTerminatingError( + ("The combination of parameters -Policy and -ManagedGroup is not allowed." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the managed device." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + } + Process { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId" + + if ($PSCmdlet.ShouldProcess($Device.ToString(), "Change managed device entry")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop | ` + Out-Null + } + } +} + + + +function Set-TeamViewerManagedGroup { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId })] + [Alias("GroupId")] + [Alias("Id")] + [object] + $Group, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByParameters')] + [string] + $Name, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByProperties')] + [hashtable] + $Property + ) + Begin { + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Property + + $body = @{} + switch ($PSCmdlet.ParameterSetName) { + 'ByParameters' { + $body['name'] = $Name + } + 'ByProperties' { + @('name') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the managed group." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + } + Process { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId" + + if ($PSCmdlet.ShouldProcess($groupId, "Update managed group")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Set-TeamViewerManager { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'Device_ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true, ValueFromPipeline = $true)] + [ValidateScript( { + if (($_.PSObject.TypeNames -contains 'TeamViewerPS.Manager') -And -Not $_.GroupId -And -Not $_.DeviceId) { + $PSCmdlet.ThrowTerminatingError( + ("Invalid manager object. Manager must be a group or device manager." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + $_ | Resolve-TeamViewerManagerId + })] + [Alias("ManagerId")] + [Alias("Id")] + [object] + $Manager, + + [Parameter(ParameterSetName = 'Device_ByParameters')] + [Parameter(ParameterSetName = 'Device_ByProperties')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedDeviceId } )] + [Alias("DeviceId")] + [object] + $Device, + + [Parameter(ParameterSetName = 'Group_ByParameters')] + [Parameter(ParameterSetName = 'Group_ByProperties')] + [ValidateScript( { $_ | Resolve-TeamViewerManagedGroupId })] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(ParameterSetName = 'Device_ByParameters')] + [Parameter(ParameterSetName = 'Group_ByParameters')] + [AllowEmptyCollection()] + [string[]] + $Permissions, + + [Parameter(Mandatory = $true, ParameterSetName = 'Device_ByProperties')] + [Parameter(Mandatory = $true, ParameterSetName = 'Group_ByProperties')] + [hashtable] + $Property + ) + Begin { + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Property + + $body = @{} + switch -Wildcard ($PSCmdlet.ParameterSetName) { + '*ByParameters' { + $body['permissions'] = @($Permissions) + } + '*ByProperties' { + @('permissions') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the manager." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + } + Process { + $deviceId = $null + $groupId = $null + if ($Manager.PSObject.TypeNames -contains 'TeamViewerPS.Manager') { + if ($Device -Or $Group) { + $PSCmdlet.ThrowTerminatingError( + ("Device or Group parameter must not be specified if a [TeamViewerPS.Manager] object is given." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + if ($Manager.DeviceId) { + $deviceId = $Manager.DeviceId + } + elseif ($Manager.GroupId) { + $groupId = $Manager.GroupId + } + } + elseif ($Device) { + $deviceId = $Device | Resolve-TeamViewerManagedDeviceId + } + elseif ($Group) { + $groupId = $Group | Resolve-TeamViewerManagedGroupId + } + else { + $PSCmdlet.ThrowTerminatingError( + ("Device or Group parameter must be specified if no [TeamViewerPS.Manager] object is given." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $managerId = $Manager | Resolve-TeamViewerManagerId + if ($deviceId) { + $resourceUri = "$(Get-TeamViewerApiUri)/managed/devices/$deviceId/managers/$managerId" + $processMessage = "Update managed device manager" + } + elseif ($groupId) { + $resourceUri = "$(Get-TeamViewerApiUri)/managed/groups/$groupId/managers/$managerId" + $processMessage = "Update managed group manager" + } + + if ($PSCmdlet.ShouldProcess($managerId, $processMessage)) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } + } +} + + + +function Set-TeamViewerPolicy { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerPolicyId } )] + [Alias('PolicyId')] + [object] + $Policy, + + [Parameter(ParameterSetName = 'ByParameters')] + [string] + $Name, + + [Parameter(ParameterSetName = 'ByParameters')] + [object[]] + $Settings, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByProperties')] + [hashtable] + $Property + ) + # Warning suppresion doesn't seem to work. + # See https://github.com/PowerShell/PSScriptAnalyzer/issues/1472 + $null = $Property + + $body = @{} + switch ($PSCmdlet.ParameterSetName) { + 'ByParameters' { + if ($Name) { + $body['name'] = $Name + } + if ($Settings) { + $body['settings'] = $Settings + } + } + 'ByProperties' { + @('name', 'settings') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the policy." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $policyId = $Policy | Resolve-TeamViewerPolicyId + $resourceUri = "$(Get-TeamViewerApiUri)/teamviewerpolicies/$policyId" + + if ($PSCmdlet.ShouldProcess($policyId, "Update policy")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json -Depth 25))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +$global:TeamViewerProxyUriSet = $null + +function Set-TeamViewerPSProxy { + [CmdletBinding(SupportsShouldProcess =$true)] + param ( + [Parameter(Mandatory=$true)] + [Uri] + $ProxyUri + ) + + if($PSCmdlet.ShouldProcess($ProxyUri,"Sets proxy for WebAPI")){ + $global:TeamViewerProxyUriSet = $ProxyUri + $global:TeamViewerProxyUriRemoved = $false + $global:TeamViewerProxyUriRemoved | Out-Null + + [Environment]::SetEnvironmentVariable("TeamViewerProxyUri", $ProxyUri, "User") + + Write-Output "Proxy set to $TeamViewerProxyUriSet" + } +} + + + + +function Set-TeamViewerUser { + [CmdletBinding(SupportsShouldProcess = $true, DefaultParameterSetName = 'ByParameters')] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserId } )] + [Alias("UserId")] + [Alias("Id")] + [object] + $User, + + [Parameter(ParameterSetName = 'ByParameters')] + [boolean] + $Active, + + [Parameter(ParameterSetName = 'ByParameters')] + [Alias('EmailAddress')] + [string] + $Email, + + [Parameter(ParameterSetName = 'ByParameters')] + [Alias('DisplayName')] + [string] + $Name, + + [Parameter(ParameterSetName = 'ByParameters')] + [securestring] + $Password, + + [Parameter(ParameterSetName = 'ByParameters')] + [securestring] + $SsoCustomerIdentifier, + + [Parameter(ParameterSetName = 'ByParameters')] + [array] + $Permissions, + + [Parameter(Mandatory = $true, ParameterSetName = 'ByProperties')] + [hashtable] + $Property + ) + + $body = @{} + switch ($PSCmdlet.ParameterSetName) { + 'ByParameters' { + if ($PSBoundParameters.ContainsKey('Active')) { + $body['active'] = $Active + } + if ($Email) { + $body['email'] = $Email + } + if ($Name) { + $body['name'] = $Name + } + if ($Password) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password) + $body['password'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + if ($SsoCustomerIdentifier) { + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SsoCustomerIdentifier) + $body['sso_customer_id'] = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) | Out-Null + } + if ($Permissions) { + $body['permissions'] = $Permissions -join ',' + } + } + 'ByProperties' { + @('active', 'email', 'name', 'password', 'sso_customer_id', 'permissions') | ` + Where-Object { $Property[$_] } | ` + ForEach-Object { $body[$_] = $Property[$_] } + } + } + + if ($body.Count -eq 0) { + $PSCmdlet.ThrowTerminatingError( + ("The given input does not change the user." | ` + ConvertTo-ErrorRecord -ErrorCategory InvalidArgument)) + } + + $userId = Resolve-TeamViewerUserId -User $User + $resourceUri = "$(Get-TeamViewerApiUri)/users/$userId" + + if ($PSCmdlet.ShouldProcess($userId, "Update user profile")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + +function Set-TeamViewerUserGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserGroupId } )] + [Alias("UserGroupId")] + [Alias("Id")] + [object] + $UserGroup, + + [Parameter(Mandatory = $true)] + [Alias("UserGroupName")] + [string] + $Name + ) + Begin { + $id = $UserGroup | Resolve-TeamViewerUserGroupId + $resourceUri = "$(Get-TeamViewerApiUri)/usergroups/$id" + $body = @{ name = $Name } + } + Process { + if ($PSCmdlet.ShouldProcess($UserGroup.ToString(), "Change user group")) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + Write-Output ($response | ConvertTo-TeamViewerUserGroup) + } + } +} + + + + +function Set-TeamViewerUserRole { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true )] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [Alias('UserRoleName')] + [string] + $Name, + + [Parameter(Mandatory = $false)] + [AllowEmptyCollection()] + [object[]] + $Permissions, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerUserRoleId } )] + [Alias('UserRole')] + [object] + $UserRoleId + ) + Begin { + $resourceUri = "$(Get-TeamViewerApiUri)/userroles" + $body = @{ + Name = $Name + Permissions = @() + UserRoleId = $UserRoleId + + } + if ($Permissions) { + $body.Permissions = @($Permissions) + } + } + Process { + if ($PSCmdlet.ShouldProcess($Name, 'Update User Role')) { + $response = Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Put ` + -ContentType 'application/json; charset=utf-8' ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet ` + -ErrorAction Stop + + $result = $response + Write-Output $result + } + } + +} + + + +function Start-TeamViewerService { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + if ($PSCmdlet.ShouldProcess("TeamViewer service")) { + switch (Get-OperatingSystem) { + 'Windows' { + Start-Service -Name (Get-TeamViewerServiceName) + } + 'Linux' { + Invoke-ExternalCommand /opt/teamviewer/tv_bin/script/teamviewer daemon start + } + } + } +} + + + +function Stop-TeamViewerService { + [CmdletBinding(SupportsShouldProcess = $true)] + param() + + if ($PSCmdlet.ShouldProcess("TeamViewer service")) { + switch (Get-OperatingSystem) { + 'Windows' { + Stop-Service -Name (Get-TeamViewerServiceName) + } + 'Linux' { + Invoke-ExternalCommand /opt/teamviewer/tv_bin/script/teamviewer daemon stop + } + } + } +} + + + +function Test-TeamViewerConnectivity { + param( + [Parameter()] + [switch] + $Quiet + ) + + $endpoints = @( + @{ Hostname = 'webapi.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'login.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'meeting.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'sso.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'download.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'configdl.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'get.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'go.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'client.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'feedbackservice.teamviewer.com'; TcpPort = 443; } + @{ Hostname = 'remotescriptingstorage.blob.core.windows.net'; TcpPort = 443; } + @{ Hostname = 'chatlivestorage.blob.core.windows.net'; TcpPort = 443; } + ) + 1..16 | ForEach-Object { + $endpoints += @{ Hostname = "router$_.teamviewer.com"; TcpPort = (5938, 443, 80) } + } + + $results = $endpoints | ForEach-Object { + $endpoint = $_ + $portSucceeded = $endpoint.TcpPort | Where-Object { + Write-Verbose "Checking endpoint $($endpoint.Hostname) on port $_" + Test-TcpConnection -Hostname $endpoint.Hostname -Port $_ + } | Select-Object -First 1 + $endpoint.Succeeded = [bool]$portSucceeded + $endpoint.TcpPort = if ($endpoint.Succeeded) { $portSucceeded } else { $endpoint.TcpPort } + return $endpoint + } + + if ($Quiet) { + ![bool]($results | Where-Object { -Not $_.Succeeded }) + } + else { + $results | ` + ForEach-Object { New-Object PSObject -Property $_ } | ` + Select-Object -Property Hostname, TcpPort, Succeeded | ` + Sort-Object Hostname + } +} + + + +function Test-TeamViewerInstallation { + if (Get-TeamViewerInstallationDirectory) { + return $true + } + else { + return $false + } +} + + + +function Unpublish-TeamViewerGroup { + [CmdletBinding(SupportsShouldProcess = $true)] + param( + [Parameter(Mandatory = $true)] + [securestring] + $ApiToken, + + [Parameter(Mandatory = $true)] + [ValidateScript( { $_ | Resolve-TeamViewerGroupId } )] + [Alias("GroupId")] + [object] + $Group, + + [Parameter(Mandatory = $true)] + [Alias("UserId")] + [object[]] + $User + ) + + $groupId = $Group | Resolve-TeamViewerGroupId + $userIds = $User | Resolve-TeamViewerUserId + $resourceUri = "$(Get-TeamViewerApiUri)/groups/$groupId/unshare_group" + $body = @{users = @($userIds) } + + if ($PSCmdlet.ShouldProcess($userids, "Remove group share")) { + Invoke-TeamViewerRestMethod ` + -ApiToken $ApiToken ` + -Uri $resourceUri ` + -Method Post ` + -ContentType "application/json; charset=utf-8" ` + -Body ([System.Text.Encoding]::UTF8.GetBytes(($body | ConvertTo-Json))) ` + -WriteErrorTo $PSCmdlet | ` + Out-Null + } +} + + + diff --git a/docs/about_TeamViewerPS.md b/Cmdlets/about_TeamViewerPS.md similarity index 100% rename from docs/about_TeamViewerPS.md rename to Cmdlets/about_TeamViewerPS.md diff --git a/docs/Cmdlets_help/Add-TeamViewerAssignment.md b/Docs/Help/Add-TeamViewerAssignment.md similarity index 97% rename from docs/Cmdlets_help/Add-TeamViewerAssignment.md rename to Docs/Help/Add-TeamViewerAssignment.md index 873289f..c392d33 100644 --- a/docs/Cmdlets_help/Add-TeamViewerAssignment.md +++ b/Docs/Help/Add-TeamViewerAssignment.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerAssignment.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerAssignment.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Add-TeamViewerCustomization.md b/Docs/Help/Add-TeamViewerCustomization.md similarity index 98% rename from docs/Cmdlets_help/Add-TeamViewerCustomization.md rename to Docs/Help/Add-TeamViewerCustomization.md index 876c4dc..41c281c 100644 --- a/docs/Cmdlets_help/Add-TeamViewerCustomization.md +++ b/Docs/Help/Add-TeamViewerCustomization.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerCustomization.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerCustomization.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Add-TeamViewerManagedDevice.md b/Docs/Help/Add-TeamViewerManagedDevice.md similarity index 98% rename from docs/Cmdlets_help/Add-TeamViewerManagedDevice.md rename to Docs/Help/Add-TeamViewerManagedDevice.md index 6d32343..90e1aeb 100644 --- a/docs/Cmdlets_help/Add-TeamViewerManagedDevice.md +++ b/Docs/Help/Add-TeamViewerManagedDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerManagedDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerManagedDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Add-TeamViewerManager.md b/Docs/Help/Add-TeamViewerManager.md similarity index 98% rename from docs/Cmdlets_help/Add-TeamViewerManager.md rename to Docs/Help/Add-TeamViewerManager.md index 2bbbeb0..fce955a 100644 --- a/docs/Cmdlets_help/Add-TeamViewerManager.md +++ b/Docs/Help/Add-TeamViewerManager.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerManager.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerManager.md schema: 2.0.0 --- @@ -220,7 +220,7 @@ Multiple values can be specified. device or group. `DeviceAdministration` (only for managed devices) allows the manager to change -device-specific properties, e.g. the device name. Also reqruied to add devices +device-specific properties, e.g. the device name. Also required to add devices to managed groups. `GroupAdministration` (only for managed groups) allows the manager to change diff --git a/docs/Cmdlets_help/Add-TeamViewerRoleToAccount.md b/Docs/Help/Add-TeamViewerRoleToAccount.md similarity index 98% rename from docs/Cmdlets_help/Add-TeamViewerRoleToAccount.md rename to Docs/Help/Add-TeamViewerRoleToAccount.md index 6eaa3ef..518164a 100644 --- a/docs/Cmdlets_help/Add-TeamViewerRoleToAccount.md +++ b/Docs/Help/Add-TeamViewerRoleToAccount.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerRoleToAccount.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerRoleToAccount.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Add-TeamViewerRoleToUserGroup.md b/Docs/Help/Add-TeamViewerRoleToUserGroup.md similarity index 97% rename from docs/Cmdlets_help/Add-TeamViewerRoleToUserGroup.md rename to Docs/Help/Add-TeamViewerRoleToUserGroup.md index ce3dfa6..4f7e88c 100644 --- a/docs/Cmdlets_help/Add-TeamViewerRoleToUserGroup.md +++ b/Docs/Help/Add-TeamViewerRoleToUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerRoleToUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerRoleToUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Add-TeamViewerSsoExclusion.md b/Docs/Help/Add-TeamViewerSsoExclusion.md similarity index 95% rename from docs/Cmdlets_help/Add-TeamViewerSsoExclusion.md rename to Docs/Help/Add-TeamViewerSsoExclusion.md index 29f9a0b..7b200ca 100644 --- a/docs/Cmdlets_help/Add-TeamViewerSsoExclusion.md +++ b/Docs/Help/Add-TeamViewerSsoExclusion.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerSsoExclusion.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerSsoExclusion.md schema: 2.0.0 --- @@ -32,7 +32,7 @@ Sign-On but use their TeamViewer account password instead. PS /> Add-TeamViewerSsoExclusion -DomainId '45e0d050-15e6-4fcb-91b2-ea4f20fe2085' -Email 'user@example.test' ``` -Adds the email address 'user@example.test' to the exclusion list of the given +Adds the email address '' to the exclusion list of the given domain. ## PARAMETERS diff --git a/docs/Cmdlets_help/Add-TeamViewerUserGroupMember.md b/Docs/Help/Add-TeamViewerUserGroupMember.md similarity index 98% rename from docs/Cmdlets_help/Add-TeamViewerUserGroupMember.md rename to Docs/Help/Add-TeamViewerUserGroupMember.md index 227136f..461f6b0 100644 --- a/docs/Cmdlets_help/Add-TeamViewerUserGroupMember.md +++ b/Docs/Help/Add-TeamViewerUserGroupMember.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Add-TeamViewerUserGroupMember.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Add-TeamViewerUserGroupMember.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Connect-TeamViewerApi.md b/Docs/Help/Connect-TeamViewerApi.md similarity index 96% rename from docs/Cmdlets_help/Connect-TeamViewerApi.md rename to Docs/Help/Connect-TeamViewerApi.md index 015a8be..ec5208e 100644 --- a/docs/Cmdlets_help/Connect-TeamViewerApi.md +++ b/Docs/Help/Connect-TeamViewerApi.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Connect-TeamViewerApi.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Connect-TeamViewerApi.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Disconnect-TeamViewerApi.md b/Docs/Help/Disconnect-TeamViewerApi.md similarity index 95% rename from docs/Cmdlets_help/Disconnect-TeamViewerApi.md rename to Docs/Help/Disconnect-TeamViewerApi.md index 6c5f1e6..e8d08a1 100644 --- a/docs/Cmdlets_help/Disconnect-TeamViewerApi.md +++ b/Docs/Help/Disconnect-TeamViewerApi.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Disconnect-TeamViewerApi.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Disconnect-TeamViewerApi.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Export-TeamViewerSystemInformation.md b/Docs/Help/Export-TeamViewerSystemInformation.md similarity index 96% rename from docs/Cmdlets_help/Export-TeamViewerSystemInformation.md rename to Docs/Help/Export-TeamViewerSystemInformation.md index 1eacf6e..7129f7f 100644 --- a/docs/Cmdlets_help/Export-TeamViewerSystemInformation.md +++ b/Docs/Help/Export-TeamViewerSystemInformation.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Export-TeamViewerSystemInformation.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Export-TeamViewerSystemInformation.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerAccount.md b/Docs/Help/Get-TeamViewerAccount.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerAccount.md rename to Docs/Help/Get-TeamViewerAccount.md index 2052426..e421e0c 100644 --- a/docs/Cmdlets_help/Get-TeamViewerAccount.md +++ b/Docs/Help/Get-TeamViewerAccount.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerAccount.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerAccount.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerConnectionReport.md b/Docs/Help/Get-TeamViewerConnectionReport.md similarity index 99% rename from docs/Cmdlets_help/Get-TeamViewerConnectionReport.md rename to Docs/Help/Get-TeamViewerConnectionReport.md index 6e5923f..c0f7ac6 100644 --- a/docs/Cmdlets_help/Get-TeamViewerConnectionReport.md +++ b/Docs/Help/Get-TeamViewerConnectionReport.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerConnectionReport.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerConnectionReport.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerContact.md b/Docs/Help/Get-TeamViewerContact.md similarity index 98% rename from docs/Cmdlets_help/Get-TeamViewerContact.md rename to Docs/Help/Get-TeamViewerContact.md index 233ca74..ef6c2fe 100644 --- a/docs/Cmdlets_help/Get-TeamViewerContact.md +++ b/Docs/Help/Get-TeamViewerContact.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerContact.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerContact.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerCustomModuleId.md b/Docs/Help/Get-TeamViewerCustomModuleId.md similarity index 92% rename from docs/Cmdlets_help/Get-TeamViewerCustomModuleId.md rename to Docs/Help/Get-TeamViewerCustomModuleId.md index efe5c9e..a03278f 100644 --- a/docs/Cmdlets_help/Get-TeamViewerCustomModuleId.md +++ b/Docs/Help/Get-TeamViewerCustomModuleId.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerCustomModuleId.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerCustomModuleId.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerDevice.md b/Docs/Help/Get-TeamViewerDevice.md similarity index 98% rename from docs/Cmdlets_help/Get-TeamViewerDevice.md rename to Docs/Help/Get-TeamViewerDevice.md index cf40053..052b7aa 100644 --- a/docs/Cmdlets_help/Get-TeamViewerDevice.md +++ b/Docs/Help/Get-TeamViewerDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerEventLog.md b/Docs/Help/Get-TeamViewerEventLog.md similarity index 99% rename from docs/Cmdlets_help/Get-TeamViewerEventLog.md rename to Docs/Help/Get-TeamViewerEventLog.md index 072a2fd..ff499a5 100644 --- a/docs/Cmdlets_help/Get-TeamViewerEventLog.md +++ b/Docs/Help/Get-TeamViewerEventLog.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerEventLog.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerEventLog.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerGroup.md b/Docs/Help/Get-TeamViewerGroup.md similarity index 98% rename from docs/Cmdlets_help/Get-TeamViewerGroup.md rename to Docs/Help/Get-TeamViewerGroup.md index 1f248a9..4e714e1 100644 --- a/docs/Cmdlets_help/Get-TeamViewerGroup.md +++ b/Docs/Help/Get-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerId.md b/Docs/Help/Get-TeamViewerId.md similarity index 95% rename from docs/Cmdlets_help/Get-TeamViewerId.md rename to Docs/Help/Get-TeamViewerId.md index 912b0f5..0f95950 100644 --- a/docs/Cmdlets_help/Get-TeamViewerId.md +++ b/Docs/Help/Get-TeamViewerId.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerId.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerId.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerInstallationDirectory.md b/Docs/Help/Get-TeamViewerInstallationDirectory.md similarity index 91% rename from docs/Cmdlets_help/Get-TeamViewerInstallationDirectory.md rename to Docs/Help/Get-TeamViewerInstallationDirectory.md index 4ada3b1..785e488 100644 --- a/docs/Cmdlets_help/Get-TeamViewerInstallationDirectory.md +++ b/Docs/Help/Get-TeamViewerInstallationDirectory.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerInstallationDirectory.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerInstallationDirectory.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerLogFilePath.md b/Docs/Help/Get-TeamViewerLogFilePath.md similarity index 95% rename from docs/Cmdlets_help/Get-TeamViewerLogFilePath.md rename to Docs/Help/Get-TeamViewerLogFilePath.md index 33396a8..54b0938 100644 --- a/docs/Cmdlets_help/Get-TeamViewerLogFilePath.md +++ b/Docs/Help/Get-TeamViewerLogFilePath.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerLogFilePath +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerLogFilePath schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerManagedDevice.md b/Docs/Help/Get-TeamViewerManagedDevice.md similarity index 98% rename from docs/Cmdlets_help/Get-TeamViewerManagedDevice.md rename to Docs/Help/Get-TeamViewerManagedDevice.md index d214115..a3945e3 100644 --- a/docs/Cmdlets_help/Get-TeamViewerManagedDevice.md +++ b/Docs/Help/Get-TeamViewerManagedDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerManagedDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerManagedDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerManagedGroup.md b/Docs/Help/Get-TeamViewerManagedGroup.md similarity index 97% rename from docs/Cmdlets_help/Get-TeamViewerManagedGroup.md rename to Docs/Help/Get-TeamViewerManagedGroup.md index c4d44b3..06d3002 100644 --- a/docs/Cmdlets_help/Get-TeamViewerManagedGroup.md +++ b/Docs/Help/Get-TeamViewerManagedGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerManagedGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerManagedGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerManagementId.md b/Docs/Help/Get-TeamViewerManagementId.md similarity index 94% rename from docs/Cmdlets_help/Get-TeamViewerManagementId.md rename to Docs/Help/Get-TeamViewerManagementId.md index f7629be..aa331fe 100644 --- a/docs/Cmdlets_help/Get-TeamViewerManagementId.md +++ b/Docs/Help/Get-TeamViewerManagementId.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerManagementId.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerManagementId.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerManager.md b/Docs/Help/Get-TeamViewerManager.md similarity index 97% rename from docs/Cmdlets_help/Get-TeamViewerManager.md rename to Docs/Help/Get-TeamViewerManager.md index 2f608fa..831373e 100644 --- a/docs/Cmdlets_help/Get-TeamViewerManager.md +++ b/Docs/Help/Get-TeamViewerManager.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerManager.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerManager.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerPolicy.md b/Docs/Help/Get-TeamViewerPolicy.md similarity index 97% rename from docs/Cmdlets_help/Get-TeamViewerPolicy.md rename to Docs/Help/Get-TeamViewerPolicy.md index 143b190..eafc5e6 100644 --- a/docs/Cmdlets_help/Get-TeamViewerPolicy.md +++ b/Docs/Help/Get-TeamViewerPolicy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerPolicy.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerPolicy.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToAccount.md b/Docs/Help/Get-TeamViewerRoleAssignmentToAccount.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToAccount.md rename to Docs/Help/Get-TeamViewerRoleAssignmentToAccount.md index 47d8ec0..cc9b3bc 100644 --- a/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToAccount.md +++ b/Docs/Help/Get-TeamViewerRoleAssignmentToAccount.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToAccount.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerRoleAssignmentToAccount.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToUserGroup.md b/Docs/Help/Get-TeamViewerRoleAssignmentToUserGroup.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToUserGroup.md rename to Docs/Help/Get-TeamViewerRoleAssignmentToUserGroup.md index abc39fc..d96ae56 100644 --- a/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToUserGroup.md +++ b/Docs/Help/Get-TeamViewerRoleAssignmentToUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerRoleAssignmentToUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerRoleAssignmentToUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerService.md b/Docs/Help/Get-TeamViewerService.md similarity index 95% rename from docs/Cmdlets_help/Get-TeamViewerService.md rename to Docs/Help/Get-TeamViewerService.md index 3d9ae9a..f9a73f4 100644 --- a/docs/Cmdlets_help/Get-TeamViewerService.md +++ b/Docs/Help/Get-TeamViewerService.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerService.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerService.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerSsoDomain.md b/Docs/Help/Get-TeamViewerSsoDomain.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerSsoDomain.md rename to Docs/Help/Get-TeamViewerSsoDomain.md index 5a5f4f5..0deee91 100644 --- a/docs/Cmdlets_help/Get-TeamViewerSsoDomain.md +++ b/Docs/Help/Get-TeamViewerSsoDomain.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerSsoDomain.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerSsoDomain.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerSsoExclusion.md b/Docs/Help/Get-TeamViewerSsoExclusion.md similarity index 97% rename from docs/Cmdlets_help/Get-TeamViewerSsoExclusion.md rename to Docs/Help/Get-TeamViewerSsoExclusion.md index cc841ca..3faeb36 100644 --- a/docs/Cmdlets_help/Get-TeamViewerSsoExclusion.md +++ b/Docs/Help/Get-TeamViewerSsoExclusion.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerSsoExclusion.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerSsoExclusion.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerUser.md b/Docs/Help/Get-TeamViewerUser.md similarity index 98% rename from docs/Cmdlets_help/Get-TeamViewerUser.md rename to Docs/Help/Get-TeamViewerUser.md index c20a735..085e128 100644 --- a/docs/Cmdlets_help/Get-TeamViewerUser.md +++ b/Docs/Help/Get-TeamViewerUser.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerUser.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerUser.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerUserGroup.md b/Docs/Help/Get-TeamViewerUserGroup.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerUserGroup.md rename to Docs/Help/Get-TeamViewerUserGroup.md index fb81750..d0f4478 100644 --- a/docs/Cmdlets_help/Get-TeamViewerUserGroup.md +++ b/Docs/Help/Get-TeamViewerUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-Get-TeamViewerUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-Get-TeamViewerUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerUserGroupMember.md b/Docs/Help/Get-TeamViewerUserGroupMember.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerUserGroupMember.md rename to Docs/Help/Get-TeamViewerUserGroupMember.md index c3e2334..f2bf029 100644 --- a/docs/Cmdlets_help/Get-TeamViewerUserGroupMember.md +++ b/Docs/Help/Get-TeamViewerUserGroupMember.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerUserGroupMember.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerUserGroupMember.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerUserRole.md b/Docs/Help/Get-TeamViewerUserRole.md similarity index 96% rename from docs/Cmdlets_help/Get-TeamViewerUserRole.md rename to Docs/Help/Get-TeamViewerUserRole.md index 1fcf81a..036d199 100644 --- a/docs/Cmdlets_help/Get-TeamViewerUserRole.md +++ b/Docs/Help/Get-TeamViewerUserRole.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerUserRole.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerUserRole.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Get-TeamViewerVersion.md b/Docs/Help/Get-TeamViewerVersion.md similarity index 95% rename from docs/Cmdlets_help/Get-TeamViewerVersion.md rename to Docs/Help/Get-TeamViewerVersion.md index 9302e8a..7204fed 100644 --- a/docs/Cmdlets_help/Get-TeamViewerVersion.md +++ b/Docs/Help/Get-TeamViewerVersion.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Get-TeamViewerVersion.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Get-TeamViewerVersion.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Invoke-TeamViewerPackageDownload.md b/Docs/Help/Invoke-TeamViewerPackageDownload.md similarity index 97% rename from docs/Cmdlets_help/Invoke-TeamViewerPackageDownload.md rename to Docs/Help/Invoke-TeamViewerPackageDownload.md index 51fa4ea..4a2e10e 100644 --- a/docs/Cmdlets_help/Invoke-TeamViewerPackageDownload.md +++ b/Docs/Help/Invoke-TeamViewerPackageDownload.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Invoke-TeamViewerPackageDownload.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Invoke-TeamViewerPackageDownload.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Invoke-TeamViewerPing.md b/Docs/Help/Invoke-TeamViewerPing.md similarity index 96% rename from docs/Cmdlets_help/Invoke-TeamViewerPing.md rename to Docs/Help/Invoke-TeamViewerPing.md index 39f793d..a7d0ed9 100644 --- a/docs/Cmdlets_help/Invoke-TeamViewerPing.md +++ b/Docs/Help/Invoke-TeamViewerPing.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Invoke-TeamViewerPing.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Invoke-TeamViewerPing.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerContact.md b/Docs/Help/New-TeamViewerContact.md similarity index 98% rename from docs/Cmdlets_help/New-TeamViewerContact.md rename to Docs/Help/New-TeamViewerContact.md index a4a4f97..c11bd1e 100644 --- a/docs/Cmdlets_help/New-TeamViewerContact.md +++ b/Docs/Help/New-TeamViewerContact.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerContact.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerContact.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerDevice.md b/Docs/Help/New-TeamViewerDevice.md similarity index 98% rename from docs/Cmdlets_help/New-TeamViewerDevice.md rename to Docs/Help/New-TeamViewerDevice.md index 9527489..a5dc743 100644 --- a/docs/Cmdlets_help/New-TeamViewerDevice.md +++ b/Docs/Help/New-TeamViewerDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerGroup.md b/Docs/Help/New-TeamViewerGroup.md similarity index 98% rename from docs/Cmdlets_help/New-TeamViewerGroup.md rename to Docs/Help/New-TeamViewerGroup.md index f58eccd..211c6c1 100644 --- a/docs/Cmdlets_help/New-TeamViewerGroup.md +++ b/Docs/Help/New-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerManagedGroup.md b/Docs/Help/New-TeamViewerManagedGroup.md similarity index 97% rename from docs/Cmdlets_help/New-TeamViewerManagedGroup.md rename to Docs/Help/New-TeamViewerManagedGroup.md index ad96a8f..8b776b3 100644 --- a/docs/Cmdlets_help/New-TeamViewerManagedGroup.md +++ b/Docs/Help/New-TeamViewerManagedGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerManagedGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerManagedGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerPolicy.md b/Docs/Help/New-TeamViewerPolicy.md similarity index 98% rename from docs/Cmdlets_help/New-TeamViewerPolicy.md rename to Docs/Help/New-TeamViewerPolicy.md index 36c2e21..987ba0b 100644 --- a/docs/Cmdlets_help/New-TeamViewerPolicy.md +++ b/Docs/Help/New-TeamViewerPolicy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerPolicy.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerPolicy.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerUser.md b/Docs/Help/New-TeamViewerUser.md similarity index 99% rename from docs/Cmdlets_help/New-TeamViewerUser.md rename to Docs/Help/New-TeamViewerUser.md index 59193f1..7d512da 100644 --- a/docs/Cmdlets_help/New-TeamViewerUser.md +++ b/Docs/Help/New-TeamViewerUser.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerUser.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerUser.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerUserGroup.md b/Docs/Help/New-TeamViewerUserGroup.md similarity index 97% rename from docs/Cmdlets_help/New-TeamViewerUserGroup.md rename to Docs/Help/New-TeamViewerUserGroup.md index a316b33..77e3431 100644 --- a/docs/Cmdlets_help/New-TeamViewerUserGroup.md +++ b/Docs/Help/New-TeamViewerUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/New-TeamViewerUserRole.md b/Docs/Help/New-TeamViewerUserRole.md similarity index 98% rename from docs/Cmdlets_help/New-TeamViewerUserRole.md rename to Docs/Help/New-TeamViewerUserRole.md index f6deb32..766ebe1 100644 --- a/docs/Cmdlets_help/New-TeamViewerUserRole.md +++ b/Docs/Help/New-TeamViewerUserRole.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/New-TeamViewerUserRole.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/New-TeamViewerUserRole.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Publish-TeamViewerGroup.md b/Docs/Help/Publish-TeamViewerGroup.md similarity index 98% rename from docs/Cmdlets_help/Publish-TeamViewerGroup.md rename to Docs/Help/Publish-TeamViewerGroup.md index db62dec..d055ab9 100644 --- a/docs/Cmdlets_help/Publish-TeamViewerGroup.md +++ b/Docs/Help/Publish-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Publish-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Publish-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerAssignment.md b/Docs/Help/Remove-TeamViewerAssignment.md similarity index 91% rename from docs/Cmdlets_help/Remove-TeamViewerAssignment.md rename to Docs/Help/Remove-TeamViewerAssignment.md index 5635c9a..ce7a5c8 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerAssignment.md +++ b/Docs/Help/Remove-TeamViewerAssignment.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerAssignment.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerAssignment.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerContact.md b/Docs/Help/Remove-TeamViewerContact.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerContact.md rename to Docs/Help/Remove-TeamViewerContact.md index f9a6981..40d3219 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerContact.md +++ b/Docs/Help/Remove-TeamViewerContact.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerContact.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerContact.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerCustomization.md b/Docs/Help/Remove-TeamViewerCustomization.md similarity index 92% rename from docs/Cmdlets_help/Remove-TeamViewerCustomization.md rename to Docs/Help/Remove-TeamViewerCustomization.md index d42f16c..61778f4 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerCustomization.md +++ b/Docs/Help/Remove-TeamViewerCustomization.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerCustomization.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerCustomization.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerDevice.md b/Docs/Help/Remove-TeamViewerDevice.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerDevice.md rename to Docs/Help/Remove-TeamViewerDevice.md index 5cb101e..8ce6b1a 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerDevice.md +++ b/Docs/Help/Remove-TeamViewerDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerGroup.md b/Docs/Help/Remove-TeamViewerGroup.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerGroup.md rename to Docs/Help/Remove-TeamViewerGroup.md index c1aa0b2..2a3906a 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerGroup.md +++ b/Docs/Help/Remove-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerManagedDevice.md b/Docs/Help/Remove-TeamViewerManagedDevice.md similarity index 98% rename from docs/Cmdlets_help/Remove-TeamViewerManagedDevice.md rename to Docs/Help/Remove-TeamViewerManagedDevice.md index d205174..4045cb1 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerManagedDevice.md +++ b/Docs/Help/Remove-TeamViewerManagedDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerManagedDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerManagedDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerManagedDeviceManagement.md b/Docs/Help/Remove-TeamViewerManagedDeviceManagement.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerManagedDeviceManagement.md rename to Docs/Help/Remove-TeamViewerManagedDeviceManagement.md index ebfdf98..7230a0a 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerManagedDeviceManagement.md +++ b/Docs/Help/Remove-TeamViewerManagedDeviceManagement.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerManagedDeviceManagement.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerManagedDeviceManagement.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerManagedGroup.md b/Docs/Help/Remove-TeamViewerManagedGroup.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerManagedGroup.md rename to Docs/Help/Remove-TeamViewerManagedGroup.md index 75be21e..8ba7a95 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerManagedGroup.md +++ b/Docs/Help/Remove-TeamViewerManagedGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerManagedGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerManagedGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerManager.md b/Docs/Help/Remove-TeamViewerManager.md similarity index 98% rename from docs/Cmdlets_help/Remove-TeamViewerManager.md rename to Docs/Help/Remove-TeamViewerManager.md index 996e3b5..8cbece9 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerManager.md +++ b/Docs/Help/Remove-TeamViewerManager.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerManager.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerManager.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerPSProxy.md b/Docs/Help/Remove-TeamViewerPSProxy.md similarity index 92% rename from docs/Cmdlets_help/Remove-TeamViewerPSProxy.md rename to Docs/Help/Remove-TeamViewerPSProxy.md index c4c3200..b0c243a 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerPSProxy.md +++ b/Docs/Help/Remove-TeamViewerPSProxy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerPSProxy +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerPSProxy schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerPolicy.md b/Docs/Help/Remove-TeamViewerPolicy.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerPolicy.md rename to Docs/Help/Remove-TeamViewerPolicy.md index 26ed60f..85d7e6f 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerPolicy.md +++ b/Docs/Help/Remove-TeamViewerPolicy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerPolicy.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerPolicy.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerPolicyFromManagedDevice.md b/Docs/Help/Remove-TeamViewerPolicyFromManagedDevice.md similarity index 100% rename from docs/Cmdlets_help/Remove-TeamViewerPolicyFromManagedDevice.md rename to Docs/Help/Remove-TeamViewerPolicyFromManagedDevice.md diff --git a/docs/Cmdlets_help/Remove-TeamViewerRoleFromAccount.md b/Docs/Help/Remove-TeamViewerRoleFromAccount.md similarity index 98% rename from docs/Cmdlets_help/Remove-TeamViewerRoleFromAccount.md rename to Docs/Help/Remove-TeamViewerRoleFromAccount.md index cc8dc6b..1856e45 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerRoleFromAccount.md +++ b/Docs/Help/Remove-TeamViewerRoleFromAccount.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerRoleFromAccount.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerRoleFromAccount.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerRoleFromUserGroup.md b/Docs/Help/Remove-TeamViewerRoleFromUserGroup.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerRoleFromUserGroup.md rename to Docs/Help/Remove-TeamViewerRoleFromUserGroup.md index e88378b..685dc3c 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerRoleFromUserGroup.md +++ b/Docs/Help/Remove-TeamViewerRoleFromUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerRoleFromUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerRoleFromUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerSsoExclusion.md b/Docs/Help/Remove-TeamViewerSsoExclusion.md similarity index 95% rename from docs/Cmdlets_help/Remove-TeamViewerSsoExclusion.md rename to Docs/Help/Remove-TeamViewerSsoExclusion.md index 63cc616..ad61ad7 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerSsoExclusion.md +++ b/Docs/Help/Remove-TeamViewerSsoExclusion.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerSsoExclusion.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerSsoExclusion.md schema: 2.0.0 --- @@ -32,7 +32,7 @@ Sign-On but use their TeamViewer account password instead. PS /> Remove-TeamViewerSsoExclusion -DomainId '45e0d050-15e6-4fcb-91b2-ea4f20fe2085' -Email 'user@example.test' ``` -Removes the email address 'user@example.test' from the exclusion list of the +Removes the email address '' from the exclusion list of the given domain. ## PARAMETERS diff --git a/docs/Cmdlets_help/Remove-TeamViewerUser.md b/Docs/Help/Remove-TeamViewerUser.md similarity index 98% rename from docs/Cmdlets_help/Remove-TeamViewerUser.md rename to Docs/Help/Remove-TeamViewerUser.md index 3fc0094..00ff8d8 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerUser.md +++ b/Docs/Help/Remove-TeamViewerUser.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerUser.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerUser.md schema: 2.0.0 --- @@ -31,7 +31,6 @@ If the switch -Permanent is added the user is delete from TeamViewer completely, PS C:\> Remove-TeamViewerUser -User 'u1234' ``` - ## PARAMETERS ### -ApiToken diff --git a/docs/Cmdlets_help/Remove-TeamViewerUserGroup.md b/Docs/Help/Remove-TeamViewerUserGroup.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerUserGroup.md rename to Docs/Help/Remove-TeamViewerUserGroup.md index a78d4fd..f95ab38 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerUserGroup.md +++ b/Docs/Help/Remove-TeamViewerUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerUserGroupMember.md b/Docs/Help/Remove-TeamViewerUserGroupMember.md similarity index 98% rename from docs/Cmdlets_help/Remove-TeamViewerUserGroupMember.md rename to Docs/Help/Remove-TeamViewerUserGroupMember.md index 281e950..212ce04 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerUserGroupMember.md +++ b/Docs/Help/Remove-TeamViewerUserGroupMember.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerUserGroupMember.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerUserGroupMember.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Remove-TeamViewerUserRole.md b/Docs/Help/Remove-TeamViewerUserRole.md similarity index 97% rename from docs/Cmdlets_help/Remove-TeamViewerUserRole.md rename to Docs/Help/Remove-TeamViewerUserRole.md index e2b0c13..ba83a1a 100644 --- a/docs/Cmdlets_help/Remove-TeamViewerUserRole.md +++ b/Docs/Help/Remove-TeamViewerUserRole.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Remove-TeamViewerUserRole.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Remove-TeamViewerUserRole.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Restart-TeamViewerService.md b/Docs/Help/Restart-TeamViewerService.md similarity index 96% rename from docs/Cmdlets_help/Restart-TeamViewerService.md rename to Docs/Help/Restart-TeamViewerService.md index f354e28..85a2483 100644 --- a/docs/Cmdlets_help/Restart-TeamViewerService.md +++ b/Docs/Help/Restart-TeamViewerService.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Restart-TeamViewerService.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Restart-TeamViewerService.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerAccount.md b/Docs/Help/Set-TeamViewerAccount.md similarity index 98% rename from docs/Cmdlets_help/Set-TeamViewerAccount.md rename to Docs/Help/Set-TeamViewerAccount.md index aefa72a..18ce4fe 100644 --- a/docs/Cmdlets_help/Set-TeamViewerAccount.md +++ b/Docs/Help/Set-TeamViewerAccount.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerAccount.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerAccount.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerDevice.md b/Docs/Help/Set-TeamViewerDevice.md similarity index 99% rename from docs/Cmdlets_help/Set-TeamViewerDevice.md rename to Docs/Help/Set-TeamViewerDevice.md index d6e77ca..780379e 100644 --- a/docs/Cmdlets_help/Set-TeamViewerDevice.md +++ b/Docs/Help/Set-TeamViewerDevice.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerDevice.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerDevice.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerGroup.md b/Docs/Help/Set-TeamViewerGroup.md similarity index 98% rename from docs/Cmdlets_help/Set-TeamViewerGroup.md rename to Docs/Help/Set-TeamViewerGroup.md index c9c8e45..f777eeb 100644 --- a/docs/Cmdlets_help/Set-TeamViewerGroup.md +++ b/Docs/Help/Set-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerManagedDevice.md b/Docs/Help/Set-TeamViewerManagedDevice.md similarity index 100% rename from docs/Cmdlets_help/Set-TeamViewerManagedDevice.md rename to Docs/Help/Set-TeamViewerManagedDevice.md diff --git a/docs/Cmdlets_help/Set-TeamViewerManagedGroup.md b/Docs/Help/Set-TeamViewerManagedGroup.md similarity index 98% rename from docs/Cmdlets_help/Set-TeamViewerManagedGroup.md rename to Docs/Help/Set-TeamViewerManagedGroup.md index 21d6bd4..2902456 100644 --- a/docs/Cmdlets_help/Set-TeamViewerManagedGroup.md +++ b/Docs/Help/Set-TeamViewerManagedGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerManagedGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerManagedGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerManager.md b/Docs/Help/Set-TeamViewerManager.md similarity index 99% rename from docs/Cmdlets_help/Set-TeamViewerManager.md rename to Docs/Help/Set-TeamViewerManager.md index 4914428..bf45e9a 100644 --- a/docs/Cmdlets_help/Set-TeamViewerManager.md +++ b/Docs/Help/Set-TeamViewerManager.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerManager.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerManager.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerPSProxy.md b/Docs/Help/Set-TeamViewerPSProxy.md similarity index 95% rename from docs/Cmdlets_help/Set-TeamViewerPSProxy.md rename to Docs/Help/Set-TeamViewerPSProxy.md index fedd0cb..0bc462d 100644 --- a/docs/Cmdlets_help/Set-TeamViewerPSProxy.md +++ b/Docs/Help/Set-TeamViewerPSProxy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerPSProxy.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerPSProxy.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerPolicy.md b/Docs/Help/Set-TeamViewerPolicy.md similarity index 98% rename from docs/Cmdlets_help/Set-TeamViewerPolicy.md rename to Docs/Help/Set-TeamViewerPolicy.md index 2d0915f..29091e1 100644 --- a/docs/Cmdlets_help/Set-TeamViewerPolicy.md +++ b/Docs/Help/Set-TeamViewerPolicy.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerPolicy.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerPolicy.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerUser.md b/Docs/Help/Set-TeamViewerUser.md similarity index 99% rename from docs/Cmdlets_help/Set-TeamViewerUser.md rename to Docs/Help/Set-TeamViewerUser.md index 8b49745..6fd6ae6 100644 --- a/docs/Cmdlets_help/Set-TeamViewerUser.md +++ b/Docs/Help/Set-TeamViewerUser.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerUser.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerUser.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerUserGroup.md b/Docs/Help/Set-TeamViewerUserGroup.md similarity index 97% rename from docs/Cmdlets_help/Set-TeamViewerUserGroup.md rename to Docs/Help/Set-TeamViewerUserGroup.md index bc9b69d..499bf21 100644 --- a/docs/Cmdlets_help/Set-TeamViewerUserGroup.md +++ b/Docs/Help/Set-TeamViewerUserGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerUserGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerUserGroup.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Set-TeamViewerUserRole.md b/Docs/Help/Set-TeamViewerUserRole.md similarity index 98% rename from docs/Cmdlets_help/Set-TeamViewerUserRole.md rename to Docs/Help/Set-TeamViewerUserRole.md index 95ff406..d54e14c 100644 --- a/docs/Cmdlets_help/Set-TeamViewerUserRole.md +++ b/Docs/Help/Set-TeamViewerUserRole.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Set-TeamViewerUserRole.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Set-TeamViewerUserRole.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Start-TeamViewerService.md b/Docs/Help/Start-TeamViewerService.md similarity index 96% rename from docs/Cmdlets_help/Start-TeamViewerService.md rename to Docs/Help/Start-TeamViewerService.md index c672810..a1ed8ec 100644 --- a/docs/Cmdlets_help/Start-TeamViewerService.md +++ b/Docs/Help/Start-TeamViewerService.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Start-TeamViewerService.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Start-TeamViewerService.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Stop-TeamViewerService.md b/Docs/Help/Stop-TeamViewerService.md similarity index 96% rename from docs/Cmdlets_help/Stop-TeamViewerService.md rename to Docs/Help/Stop-TeamViewerService.md index 26a8f0b..cacd47b 100644 --- a/docs/Cmdlets_help/Stop-TeamViewerService.md +++ b/Docs/Help/Stop-TeamViewerService.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Stop-TeamViewerService.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Stop-TeamViewerService.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Test-TeamViewerConnectivity.md b/Docs/Help/Test-TeamViewerConnectivity.md similarity index 96% rename from docs/Cmdlets_help/Test-TeamViewerConnectivity.md rename to Docs/Help/Test-TeamViewerConnectivity.md index 5e5e4b0..b1b20be 100644 --- a/docs/Cmdlets_help/Test-TeamViewerConnectivity.md +++ b/Docs/Help/Test-TeamViewerConnectivity.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Test-TeamViewerConnectivity.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Test-TeamViewerConnectivity.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Test-TeamViewerInstallation.md b/Docs/Help/Test-TeamViewerInstallation.md similarity index 94% rename from docs/Cmdlets_help/Test-TeamViewerInstallation.md rename to Docs/Help/Test-TeamViewerInstallation.md index 3b36d7f..548d498 100644 --- a/docs/Cmdlets_help/Test-TeamViewerInstallation.md +++ b/Docs/Help/Test-TeamViewerInstallation.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Test-TeamViewerInstallation.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Test-TeamViewerInstallation.md schema: 2.0.0 --- diff --git a/docs/Cmdlets_help/Unpublish-TeamViewerGroup.md b/Docs/Help/Unpublish-TeamViewerGroup.md similarity index 97% rename from docs/Cmdlets_help/Unpublish-TeamViewerGroup.md rename to Docs/Help/Unpublish-TeamViewerGroup.md index 887e2ab..33975ae 100644 --- a/docs/Cmdlets_help/Unpublish-TeamViewerGroup.md +++ b/Docs/Help/Unpublish-TeamViewerGroup.md @@ -1,7 +1,7 @@ --- external help file: TeamViewerPS-help.xml Module Name: TeamViewerPS -online version: https://github.com/teamviewer/TeamViewerPS/blob/main/docs/Cmdlets_help/Unpublish-TeamViewerGroup.md +online version: https://github.com/teamviewer/TeamViewerPS/blob/main/Docs/Help/Unpublish-TeamViewerGroup.md schema: 2.0.0 --- diff --git a/README.md b/README.md index d7a0812..2332750 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ ![CI](https://github.com/teamviewer/TeamViewerPS/workflows/CI/badge.svg) -TeamViewerPS allows to interact with the TeamViewer Web API as well as a locally -installed TeamViewer client. +TeamViewerPS allows to interact with the TeamViewer Web API as well as a locally installed TeamViewer client. ## Installation & Update @@ -13,8 +12,7 @@ Install TeamViewerPS from the Powershell Gallery using the following command: Install-Module TeamViewerPS ``` -Execute the following command to update an existing installation of -TeamViewerPS: +Execute the following command to update an existing installation of TeamViewerPS: ```powershell Update-Module TeamViewerPS @@ -22,8 +20,7 @@ Update-Module TeamViewerPS ## Usage -The following example code shows how to interact with the TeamViewer Web API -functions by retrieving the list of users of a TeamViewer company: +The following example code shows how to interact with the TeamViewer Web API functions by retrieving the list of users of a TeamViewer company: ```powershell # Downloads and installs the module from Powershell Gallery @@ -37,8 +34,8 @@ Connect-TeamViewerApi # Retrieves users of a TeamViewer company Get-TeamViewerUser ``` -Another example below shows how to display the TeamViewer ID as well as the -version of the locally installed TeamViewer client: + +Another example below shows how to display the TeamViewer ID as well as the version of the locally installed TeamViewer client: ```powershell Install-Module TeamViewerPS @@ -75,8 +72,7 @@ The module provides functions for the following categories: - _Single Sign-On management_ - _Local TeamViewer utilities_ -Please see the [about_TeamViewerPS](docs/about_TeamViewerPS.md) article for a -more detailed list. +Please see the [about_TeamViewerPS](docs/about_TeamViewerPS.md) article for a more detailed list. ## Prerequisites @@ -88,7 +84,7 @@ TeamViewerPS requires one of the following environments to run: ## License -Please see the file `LICENSE`. +Please see the file `LICENSE.md`. ## Links diff --git a/Tests/Public/Add-TeamViewerAssignment.Tests.ps1 b/Tests/Public/Add-TeamViewerAssignment.Tests.ps1 index 83c150b..fe7a981 100644 --- a/Tests/Public/Add-TeamViewerAssignment.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerAssignment.Tests.ps1 @@ -1,9 +1,9 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerAssignment.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerVersion.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerAssignment.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerVersion.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } Describe 'Add-TeamViewerAssignment' { diff --git a/Tests/Public/Add-TeamViewerCustomization.Tests.ps1 b/Tests/Public/Add-TeamViewerCustomization.Tests.ps1 index ce9e1e5..9f1dca5 100644 --- a/Tests/Public/Add-TeamViewerCustomization.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerCustomization.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerCustomization.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerCustomization.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } diff --git a/Tests/Public/Add-TeamViewerManagedDevice.Tests.ps1 b/Tests/Public/Add-TeamViewerManagedDevice.Tests.ps1 index e4997a2..34b4762 100644 --- a/Tests/Public/Add-TeamViewerManagedDevice.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerManagedDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerManagedDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerManagedDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Add-TeamViewerManager.Tests.ps1 b/Tests/Public/Add-TeamViewerManager.Tests.ps1 index dd605dc..39af1e1 100644 --- a/Tests/Public/Add-TeamViewerManager.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerManager.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerManager.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerManager.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Add-TeamViewerRoleToAccount.Tests.ps1 b/Tests/Public/Add-TeamViewerRoleToAccount.Tests.ps1 index ab247ef..9d42545 100644 --- a/Tests/Public/Add-TeamViewerRoleToAccount.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerRoleToAccount.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerRoleToAccount.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerRoleToAccount.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1 b/Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1 index d6ca0ac..4ebe068 100644 --- a/Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerRoleToUserGroup.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Add-TeamViewerSsoExclusion.Tests.ps1 b/Tests/Public/Add-TeamViewerSsoExclusion.Tests.ps1 index 2c4842f..d67f711 100644 --- a/Tests/Public/Add-TeamViewerSsoExclusion.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerSsoExclusion.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerSsoExclusion.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerSsoExclusion.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Add-TeamViewerUserGroupMember.Tests.ps1 b/Tests/Public/Add-TeamViewerUserGroupMember.Tests.ps1 index 571fb6e..2e3542c 100644 --- a/Tests/Public/Add-TeamViewerUserGroupMember.Tests.ps1 +++ b/Tests/Public/Add-TeamViewerUserGroupMember.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Add-TeamViewerUserGroupMember.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Add-TeamViewerUserGroupMember.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Connect-TeamViewerApi.Tests.ps1 b/Tests/Public/Connect-TeamViewerApi.Tests.ps1 index 3d42fb5..cb42465 100644 --- a/Tests/Public/Connect-TeamViewerApi.Tests.ps1 +++ b/Tests/Public/Connect-TeamViewerApi.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Invoke-TeamViewerPing.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Connect-TeamViewerApi.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Invoke-TeamViewerPing.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Connect-TeamViewerApi.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Disconnect-TeamViewerApi.Tests.ps1 b/Tests/Public/Disconnect-TeamViewerApi.Tests.ps1 index 494b067..0c40b4b 100644 --- a/Tests/Public/Disconnect-TeamViewerApi.Tests.ps1 +++ b/Tests/Public/Disconnect-TeamViewerApi.Tests.ps1 @@ -1,5 +1,5 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Disconnect-TeamViewerApi.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Disconnect-TeamViewerApi.ps1" } Describe 'Disconnect-TeamViewerApi' { diff --git a/Tests/Public/Export-TeamViewerSystemInformation.Tests.ps1 b/Tests/Public/Export-TeamViewerSystemInformation.Tests.ps1 index 58610ba..ab5dbab 100644 --- a/Tests/Public/Export-TeamViewerSystemInformation.Tests.ps1 +++ b/Tests/Public/Export-TeamViewerSystemInformation.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Export-TeamViewerSystemInformation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Export-TeamViewerSystemInformation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock -CommandName Test-TeamViewerInstallation { return $true } Mock -CommandName Get-OperatingSystem { return 'Windows' } diff --git a/Tests/Public/Get-TeamViewerAccount.Tests.ps1 b/Tests/Public/Get-TeamViewerAccount.Tests.ps1 index 395b6ce..0480b42 100644 --- a/Tests/Public/Get-TeamViewerAccount.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerAccount.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerAccount.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerAccount.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerConnectionReport.Tests.ps1 b/Tests/Public/Get-TeamViewerConnectionReport.Tests.ps1 index 62aad8b..1001943 100644 --- a/Tests/Public/Get-TeamViewerConnectionReport.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerConnectionReport.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../Docs/TeamViewerPS.Types.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerConnectionReport.ps1" + . "$PSScriptRoot\..\..\Cmdlets\TeamViewerPS.Types.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerConnectionReport.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} @@ -227,4 +227,4 @@ Describe 'Get-TeamViewerConnectionReport' { $body.to_date | Should -BeNullOrEmpty } } -} +} \ No newline at end of file diff --git a/Tests/Public/Get-TeamViewerContact.Tests.ps1 b/Tests/Public/Get-TeamViewerContact.Tests.ps1 index e65a62c..b1ffc82 100644 --- a/Tests/Public/Get-TeamViewerContact.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerContact.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerContact.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerContact.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerCustomModuleId.Tests.ps1 b/Tests/Public/Get-TeamViewerCustomModuleId.Tests.ps1 index 2ebd483..9efc7a2 100644 --- a/Tests/Public/Get-TeamViewerCustomModuleId.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerCustomModuleId.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerCustomModuleId.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerCustomModuleId.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } diff --git a/Tests/Public/Get-TeamViewerDevice.Tests.ps1 b/Tests/Public/Get-TeamViewerDevice.Tests.ps1 index eea87a7..25b4ad7 100644 --- a/Tests/Public/Get-TeamViewerDevice.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerEventLog.Tests.ps1 b/Tests/Public/Get-TeamViewerEventLog.Tests.ps1 index e0b8615..f3c1440 100644 --- a/Tests/Public/Get-TeamViewerEventLog.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerEventLog.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerEventLog.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerEventLog.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerGroup.Tests.ps1 b/Tests/Public/Get-TeamViewerGroup.Tests.ps1 index e439a46..ef40711 100644 --- a/Tests/Public/Get-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerId.Tests.ps1 b/Tests/Public/Get-TeamViewerId.Tests.ps1 index 519c360..348e7de 100644 --- a/Tests/Public/Get-TeamViewerId.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerId.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerId.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerId.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Get-ItemPropertyValue { 123456 } } diff --git a/Tests/Public/Get-TeamViewerInstallationDirectory.Tests.ps1 b/Tests/Public/Get-TeamViewerInstallationDirectory.Tests.ps1 index b684fb2..4877c64 100644 --- a/Tests/Public/Get-TeamViewerInstallationDirectory.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerInstallationDirectory.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } diff --git a/Tests/Public/Get-TeamViewerLogFilePath.Tests.ps1 b/Tests/Public/Get-TeamViewerLogFilePath.Tests.ps1 index 191c45b..40383a4 100644 --- a/Tests/Public/Get-TeamViewerLogFilePath.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerLogFilePath.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerLogFilePath.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerLogFilePath.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Get-TSCSearchDirectory { diff --git a/Tests/Public/Get-TeamViewerManagedDevice.Tests.ps1 b/Tests/Public/Get-TeamViewerManagedDevice.Tests.ps1 index 1058365..cf20d9b 100644 --- a/Tests/Public/Get-TeamViewerManagedDevice.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerManagedDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerManagedDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerManagedDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerManagedGroup.Tests.ps1 b/Tests/Public/Get-TeamViewerManagedGroup.Tests.ps1 index 09ee3ad..4fbf6df 100644 --- a/Tests/Public/Get-TeamViewerManagedGroup.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerManagedGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerManagedGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerManagedGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerManagementId.Tests.ps1 b/Tests/Public/Get-TeamViewerManagementId.Tests.ps1 index 97d250c..4c40770 100644 --- a/Tests/Public/Get-TeamViewerManagementId.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerManagementId.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerManagementId.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerManagementId.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testManagementId = New-Guid $null = $testManagementId @@ -11,11 +11,12 @@ BeforeAll { Describe 'Get-TeamViewerManagementId' { Context 'Windows' { BeforeAll { - function Get-TestItemValue([object]$obj) {} + function Get-TestItemValue([object]$obj) { + } Mock Get-TestItemValue ` -ParameterFilter { $obj -eq 'Unmanaged' } { } Mock Get-TestItemValue ` - -ParameterFilter { $obj -eq 'ManagementId' } { $testManagementId.ToString("B") } + -ParameterFilter { $obj -eq 'ManagementId' } { $testManagementId.ToString('B') } $testItem = [PSCustomObject]@{} $testItem | Add-Member ` -MemberType ScriptMethod ` @@ -77,7 +78,7 @@ Describe 'Get-TeamViewerManagementId' { -MockWith { } Mock Get-TeamViewerLinuxGlobalConfig ` -ParameterFilter { $Name -eq 'DeviceManagementV2\ManagementId' } ` - -MockWith { $testManagementId.ToString("B") } + -MockWith { $testManagementId.ToString('B') } } It 'Should return the Management ID from the global configuration' { diff --git a/Tests/Public/Get-TeamViewerManager.Tests.ps1 b/Tests/Public/Get-TeamViewerManager.Tests.ps1 index 69a3226..0860e72 100644 --- a/Tests/Public/Get-TeamViewerManager.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerManager.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerManager.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerManager.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerPolicy.Tests.ps1 b/Tests/Public/Get-TeamViewerPolicy.Tests.ps1 index 61bca1b..50be3d8 100644 --- a/Tests/Public/Get-TeamViewerPolicy.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerPolicy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerPolicy.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerPolicy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerRoleAssignmentToAccount.Tests.ps1 b/Tests/Public/Get-TeamViewerRoleAssignmentToAccount.Tests.ps1 index 8622899..7a330ff 100644 --- a/Tests/Public/Get-TeamViewerRoleAssignmentToAccount.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerRoleAssignmentToAccount.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToAccount.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerRoleAssignmentToAccount.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Get-TeamViewerApiUri { '//unit.test' } diff --git a/Tests/Public/Get-TeamViewerRoleAssignmentToUserGroup.Tests.ps1 b/Tests/Public/Get-TeamViewerRoleAssignmentToUserGroup.Tests.ps1 index e13febb..94593b9 100644 --- a/Tests/Public/Get-TeamViewerRoleAssignmentToUserGroup.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerRoleAssignmentToUserGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerRoleAssignmentToUserGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerRoleAssignmentToUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Get-TeamViewerApiUri { '//unit.test' } diff --git a/Tests/Public/Get-TeamViewerService.Tests.ps1 b/Tests/Public/Get-TeamViewerService.Tests.ps1 index 1ab2467..943c0f6 100644 --- a/Tests/Public/Get-TeamViewerService.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerService.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerService.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerService.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } if (-Not (Get-Command -Name 'Get-Service' -ErrorAction SilentlyContinue)) { diff --git a/Tests/Public/Get-TeamViewerSsoDomain.Tests.ps1 b/Tests/Public/Get-TeamViewerSsoDomain.Tests.ps1 index 18509fe..a74540c 100644 --- a/Tests/Public/Get-TeamViewerSsoDomain.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerSsoDomain.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerSsoDomain.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerSsoDomain.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerSsoExclusion.Tests.ps1 b/Tests/Public/Get-TeamViewerSsoExclusion.Tests.ps1 index 778c89d..610606d 100644 --- a/Tests/Public/Get-TeamViewerSsoExclusion.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerSsoExclusion.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerSsoExclusion.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerSsoExclusion.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerUser.Tests.ps1 b/Tests/Public/Get-TeamViewerUser.Tests.ps1 index 03aace6..b25503e 100644 --- a/Tests/Public/Get-TeamViewerUser.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerUser.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerUser.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerUser.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerUserGroup.Tests.ps1 b/Tests/Public/Get-TeamViewerUserGroup.Tests.ps1 index ac34349..3a9ebad 100644 --- a/Tests/Public/Get-TeamViewerUserGroup.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerUserGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerUserGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} @@ -32,8 +32,8 @@ Describe 'Get-TeamViewerUserGroup' { Assert-MockCalled Invoke-TeamViewerRestMethod -Times 1 -Scope It -ParameterFilter { $ApiToken -eq $testApiToken -And ` - $Uri -eq '//unit.test/usergroups' -And ` - $Method -eq 'Get' } + $Uri -eq '//unit.test/usergroups' -And ` + $Method -eq 'Get' } } It 'Should return UserGroup objects' { @@ -71,8 +71,8 @@ Describe 'Get-TeamViewerUserGroup' { Assert-MockCalled Invoke-TeamViewerRestMethod -Times 1 -Scope It -ParameterFilter { $ApiToken -eq $testApiToken -And ` - $Uri -eq "//unit.test/usergroups/$testUserGroupId" -And ` - $Method -eq 'Get' } + $Uri -eq "//unit.test/usergroups/$testUserGroupId" -And ` + $Method -eq 'Get' } } It 'Should handle domain object as input' { @@ -81,8 +81,8 @@ Describe 'Get-TeamViewerUserGroup' { Assert-MockCalled Invoke-TeamViewerRestMethod -Times 1 -Scope It -ParameterFilter { $ApiToken -eq $testApiToken -And ` - $Uri -eq "//unit.test/usergroups/$testUserGroupId" -And ` - $Method -eq 'Get' } + $Uri -eq "//unit.test/usergroups/$testUserGroupId" -And ` + $Method -eq 'Get' } } It 'Should return a UserGroup object' { diff --git a/Tests/Public/Get-TeamViewerUserGroupMember.Tests.ps1 b/Tests/Public/Get-TeamViewerUserGroupMember.Tests.ps1 index 622e8d3..a0314c6 100644 --- a/Tests/Public/Get-TeamViewerUserGroupMember.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerUserGroupMember.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerUserGroupMember.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerUserGroupMember.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerUserRole.Tests.ps1 b/Tests/Public/Get-TeamViewerUserRole.Tests.ps1 index 39979ce..4dc84ce 100644 --- a/Tests/Public/Get-TeamViewerUserRole.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerUserRole.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerUserRole.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerUserRole.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Get-TeamViewerVersion.Tests.ps1 b/Tests/Public/Get-TeamViewerVersion.Tests.ps1 index add13b3..09b3860 100644 --- a/Tests/Public/Get-TeamViewerVersion.Tests.ps1 +++ b/Tests/Public/Get-TeamViewerVersion.Tests.ps1 @@ -1,14 +1,14 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerVersion.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerVersion.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Get-ItemPropertyValue { '15.10.0' } } -Describe "Get-TeamViewerVersion" { +Describe 'Get-TeamViewerVersion' { Context 'Windows' { BeforeAll { Mock Get-TeamViewerRegKeyPath { 'testRegistry' } @@ -16,7 +16,7 @@ Describe "Get-TeamViewerVersion" { Mock Test-TeamViewerInstallation { $true } } - It "Should return the TeamViewer Version from the Windows Registry" { + It 'Should return the TeamViewer Version from the Windows Registry' { Get-TeamViewerVersion | Should -Be '15.10.0' Assert-MockCalled Get-ItemPropertyValue -Scope It -Times 1 -ParameterFilter { $Path -Eq 'testRegistry' -And $Name -Eq 'Version' diff --git a/Tests/Public/Invoke-TeamViewerPing.Tests.ps1 b/Tests/Public/Invoke-TeamViewerPing.Tests.ps1 index be7ad54..8520ca1 100644 --- a/Tests/Public/Invoke-TeamViewerPing.Tests.ps1 +++ b/Tests/Public/Invoke-TeamViewerPing.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Invoke-TeamViewerPing.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Invoke-TeamViewerPing.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerContact.Tests.ps1 b/Tests/Public/New-TeamViewerContact.Tests.ps1 index 92de509..e4e836a 100644 --- a/Tests/Public/New-TeamViewerContact.Tests.ps1 +++ b/Tests/Public/New-TeamViewerContact.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerContact.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerContact.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerDevice.Tests.ps1 b/Tests/Public/New-TeamViewerDevice.Tests.ps1 index 055aa1b..bc61c1b 100644 --- a/Tests/Public/New-TeamViewerDevice.Tests.ps1 +++ b/Tests/Public/New-TeamViewerDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerGroup.Tests.ps1 b/Tests/Public/New-TeamViewerGroup.Tests.ps1 index adc594f..6146f22 100644 --- a/Tests/Public/New-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/New-TeamViewerGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerManagedGroup.Tests.ps1 b/Tests/Public/New-TeamViewerManagedGroup.Tests.ps1 index 51f4a77..a1aaa36 100644 --- a/Tests/Public/New-TeamViewerManagedGroup.Tests.ps1 +++ b/Tests/Public/New-TeamViewerManagedGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerManagedGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerManagedGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerPolicy.Tests.ps1 b/Tests/Public/New-TeamViewerPolicy.Tests.ps1 index 8ca9745..06770fe 100644 --- a/Tests/Public/New-TeamViewerPolicy.Tests.ps1 +++ b/Tests/Public/New-TeamViewerPolicy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerPolicy.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerPolicy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerUser.Tests.ps1 b/Tests/Public/New-TeamViewerUser.Tests.ps1 index e323143..38888a6 100644 --- a/Tests/Public/New-TeamViewerUser.Tests.ps1 +++ b/Tests/Public/New-TeamViewerUser.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerUser.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerUser.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerUserGroup.Tests.ps1 b/Tests/Public/New-TeamViewerUserGroup.Tests.ps1 index 2ee4b6d..dfc39e1 100644 --- a/Tests/Public/New-TeamViewerUserGroup.Tests.ps1 +++ b/Tests/Public/New-TeamViewerUserGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerUserGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/New-TeamViewerUserRole.tests.ps1 b/Tests/Public/New-TeamViewerUserRole.tests.ps1 index ea41399..085e3e9 100644 --- a/Tests/Public/New-TeamViewerUserRole.tests.ps1 +++ b/Tests/Public/New-TeamViewerUserRole.tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/New-TeamViewerUserRole.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\New-TeamViewerUserRole.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ForEach-Object { . $_.FullName } + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} $null = $testApiToken diff --git a/Tests/Public/Publish-TeamViewerGroup.Tests.ps1 b/Tests/Public/Publish-TeamViewerGroup.Tests.ps1 index a7094fc..cde9ebe 100644 --- a/Tests/Public/Publish-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/Publish-TeamViewerGroup.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Publish-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Publish-TeamViewerGroup.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} $null = $testApiToken diff --git a/Tests/Public/Remove-TeamViewerAssignment.Tests.ps1 b/Tests/Public/Remove-TeamViewerAssignment.Tests.ps1 index 6e71775..e1c44da 100644 --- a/Tests/Public/Remove-TeamViewerAssignment.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerAssignment.Tests.ps1 @@ -1,9 +1,9 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerAssignment.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerVersion.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerAssignment.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerVersion.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } Describe 'Remove-TeamViewerAssignment' { diff --git a/Tests/Public/Remove-TeamViewerContact.Tests.ps1 b/Tests/Public/Remove-TeamViewerContact.Tests.ps1 index 92586de..800c0a5 100644 --- a/Tests/Public/Remove-TeamViewerContact.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerContact.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerContact.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerContact.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerCustomization.Tests.ps1 b/Tests/Public/Remove-TeamViewerCustomization.Tests.ps1 index f09c30d..2a04c00 100644 --- a/Tests/Public/Remove-TeamViewerCustomization.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerCustomization.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerCustomization.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerCustomization.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } diff --git a/Tests/Public/Remove-TeamViewerDevice.Tests.ps1 b/Tests/Public/Remove-TeamViewerDevice.Tests.ps1 index da9e90e..27a8676 100644 --- a/Tests/Public/Remove-TeamViewerDevice.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerGroup.Tests.ps1 b/Tests/Public/Remove-TeamViewerGroup.Tests.ps1 index fa50ebd..e1f541e 100644 --- a/Tests/Public/Remove-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerManagedDevice.Tests.ps1 b/Tests/Public/Remove-TeamViewerManagedDevice.Tests.ps1 index ada1a56..c937a80 100644 --- a/Tests/Public/Remove-TeamViewerManagedDevice.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerManagedDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerManagedDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerManagedDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerManagedDeviceManagement.Tests.ps1 b/Tests/Public/Remove-TeamViewerManagedDeviceManagement.Tests.ps1 index 424cd82..fab8909 100644 --- a/Tests/Public/Remove-TeamViewerManagedDeviceManagement.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerManagedDeviceManagement.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerManagedDeviceManagement.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerManagedDeviceManagement.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerManagedGroup.Tests.ps1 b/Tests/Public/Remove-TeamViewerManagedGroup.Tests.ps1 index 078a111..c48f2be 100644 --- a/Tests/Public/Remove-TeamViewerManagedGroup.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerManagedGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerManagedGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerManagedGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerManager.Tests.ps1 b/Tests/Public/Remove-TeamViewerManager.Tests.ps1 index 4fc7af4..509bad4 100644 --- a/Tests/Public/Remove-TeamViewerManager.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerManager.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerManager.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerManager.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerPSProxy.Tests.ps1 b/Tests/Public/Remove-TeamViewerPSProxy.Tests.ps1 index 674b376..b93b118 100644 --- a/Tests/Public/Remove-TeamViewerPSProxy.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerPSProxy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerPSProxy.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock -CommandName 'Remove-TeamViewerPSProxy' -MockWith { diff --git a/Tests/Public/Remove-TeamViewerPolicy.Tests.ps1 b/Tests/Public/Remove-TeamViewerPolicy.Tests.ps1 index 722e4c2..0e52ad1 100644 --- a/Tests/Public/Remove-TeamViewerPolicy.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerPolicy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerPolicy.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerPolicy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerPolicyFromManagedDevice.Tests.ps1 b/Tests/Public/Remove-TeamViewerPolicyFromManagedDevice.Tests.ps1 index 049729e..f6ed8af 100644 --- a/Tests/Public/Remove-TeamViewerPolicyFromManagedDevice.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerPolicyFromManagedDevice.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerPolicyFromManagedDevice.ps1" - . "$PSScriptRoot/../../docs/TeamViewerPS.Types.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerPolicyFromManagedDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\TeamViewerPS.Types.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerRoleFromAccount.Tests.ps1 b/Tests/Public/Remove-TeamViewerRoleFromAccount.Tests.ps1 index dbf9414..7666224 100644 --- a/Tests/Public/Remove-TeamViewerRoleFromAccount.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerRoleFromAccount.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerRoleFromAccount.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerRoleFromAccount.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerRoleFromUserGroup.Tests.ps1 b/Tests/Public/Remove-TeamViewerRoleFromUserGroup.Tests.ps1 index 750e747..257b064 100644 --- a/Tests/Public/Remove-TeamViewerRoleFromUserGroup.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerRoleFromUserGroup.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerRoleFromUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerRoleFromUserGroup.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerSsoExclusion.Tests.ps1 b/Tests/Public/Remove-TeamViewerSsoExclusion.Tests.ps1 index 1054256..775a79a 100644 --- a/Tests/Public/Remove-TeamViewerSsoExclusion.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerSsoExclusion.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerSsoExclusion.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerSsoExclusion.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerUser.Tests.ps1 b/Tests/Public/Remove-TeamViewerUser.Tests.ps1 index fc2ca78..3cbf5ef 100644 --- a/Tests/Public/Remove-TeamViewerUser.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerUser.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerUser.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerUser.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerUserGroup.Tests.ps1 b/Tests/Public/Remove-TeamViewerUserGroup.Tests.ps1 index b282c0c..437dde1 100644 --- a/Tests/Public/Remove-TeamViewerUserGroup.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerUserGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerUserGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Remove-TeamViewerUserGroupMember.Tests.ps1 b/Tests/Public/Remove-TeamViewerUserGroupMember.Tests.ps1 index e0d28e4..b0def83 100644 --- a/Tests/Public/Remove-TeamViewerUserGroupMember.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerUserGroupMember.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerUserGroupMember.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerUserGroupMember.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} $null = $testApiToken diff --git a/Tests/Public/Remove-TeamViewerUserRole.Tests.ps1 b/Tests/Public/Remove-TeamViewerUserRole.Tests.ps1 index 3694839..eb9bd07 100644 --- a/Tests/Public/Remove-TeamViewerUserRole.Tests.ps1 +++ b/Tests/Public/Remove-TeamViewerUserRole.Tests.ps1 @@ -1,8 +1,8 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerUserRole.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerUserRole.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Restart-TeamViewerService.Tests.ps1 b/Tests/Public/Restart-TeamViewerService.Tests.ps1 index 8bc37b8..b3e325d 100644 --- a/Tests/Public/Restart-TeamViewerService.Tests.ps1 +++ b/Tests/Public/Restart-TeamViewerService.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Restart-TeamViewerService.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Restart-TeamViewerService.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } if (-Not (Get-Command -Name 'Restart-Service' -ErrorAction SilentlyContinue)) { diff --git a/Tests/Public/Set-TeamViewerAccount.Tests.ps1 b/Tests/Public/Set-TeamViewerAccount.Tests.ps1 index 78e7bc1..9b129f5 100644 --- a/Tests/Public/Set-TeamViewerAccount.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerAccount.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerAccount.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerAccount.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerDevice.Tests.ps1 b/Tests/Public/Set-TeamViewerDevice.Tests.ps1 index 8bdfadf..8ef476d 100644 --- a/Tests/Public/Set-TeamViewerDevice.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerGroup.Tests.ps1 b/Tests/Public/Set-TeamViewerGroup.Tests.ps1 index 04c8b76..fb1ab24 100644 --- a/Tests/Public/Set-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerManagedDevice.Tests.ps1 b/Tests/Public/Set-TeamViewerManagedDevice.Tests.ps1 index f88bc56..3e8fd17 100644 --- a/Tests/Public/Set-TeamViewerManagedDevice.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerManagedDevice.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerManagedDevice.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerManagedDevice.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerManagedGroup.Tests.ps1 b/Tests/Public/Set-TeamViewerManagedGroup.Tests.ps1 index df73864..12eafe1 100644 --- a/Tests/Public/Set-TeamViewerManagedGroup.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerManagedGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerManagedGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerManagedGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerManager.Tests.ps1 b/Tests/Public/Set-TeamViewerManager.Tests.ps1 index e600144..8057c73 100644 --- a/Tests/Public/Set-TeamViewerManager.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerManager.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerManager.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerManager.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerPSProxy.Tests.ps1 b/Tests/Public/Set-TeamViewerPSProxy.Tests.ps1 index 9628118..fddb8ef 100644 --- a/Tests/Public/Set-TeamViewerPSProxy.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerPSProxy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerPSProxy.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ForEach-Object { . $_.FullName } + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerPSProxy.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Remove-TeamViewerPSProxy.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ForEach-Object { . $_.FullName } Mock -CommandName 'Set-TeamViewerPSProxy' -MockWith { param ( diff --git a/Tests/Public/Set-TeamViewerPolicy.Tests.ps1 b/Tests/Public/Set-TeamViewerPolicy.Tests.ps1 index d6d810b..78d49ba 100644 --- a/Tests/Public/Set-TeamViewerPolicy.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerPolicy.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerPolicy.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerPolicy.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerUser.Tests.ps1 b/Tests/Public/Set-TeamViewerUser.Tests.ps1 index a1d4a95..b9dedfe 100644 --- a/Tests/Public/Set-TeamViewerUser.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerUser.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerUser.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerUser.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerUserGroup.Tests.ps1 b/Tests/Public/Set-TeamViewerUserGroup.Tests.ps1 index 868dfd7..b5b79d0 100644 --- a/Tests/Public/Set-TeamViewerUserGroup.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerUserGroup.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerUserGroup.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerUserGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} diff --git a/Tests/Public/Set-TeamViewerUserRole.Tests.ps1 b/Tests/Public/Set-TeamViewerUserRole.Tests.ps1 index de22d5b..2c3839e 100644 --- a/Tests/Public/Set-TeamViewerUserRole.Tests.ps1 +++ b/Tests/Public/Set-TeamViewerUserRole.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Set-TeamViewerUserRole.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Set-TeamViewerUserRole.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ForEach-Object { . $_.FullName } + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} $null = $testApiToken diff --git a/Tests/Public/Start-TeamViewerService.Tests.ps1 b/Tests/Public/Start-TeamViewerService.Tests.ps1 index 31d450e..5b0bc24 100644 --- a/Tests/Public/Start-TeamViewerService.Tests.ps1 +++ b/Tests/Public/Start-TeamViewerService.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Start-TeamViewerService.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Start-TeamViewerService.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } if (-Not (Get-Command -Name 'Start-Service' -ErrorAction SilentlyContinue)) { diff --git a/Tests/Public/Stop-TeamViewerService.Tests.ps1 b/Tests/Public/Stop-TeamViewerService.Tests.ps1 index f13eb36..92129f1 100644 --- a/Tests/Public/Stop-TeamViewerService.Tests.ps1 +++ b/Tests/Public/Stop-TeamViewerService.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Stop-TeamViewerService.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Stop-TeamViewerService.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } if (-Not (Get-Command -Name 'Stop-Service' -ErrorAction SilentlyContinue)) { diff --git a/Tests/Public/Test-TeamViewerConnectivity.Tests.ps1 b/Tests/Public/Test-TeamViewerConnectivity.Tests.ps1 index 8de6069..31f3fcc 100644 --- a/Tests/Public/Test-TeamViewerConnectivity.Tests.ps1 +++ b/Tests/Public/Test-TeamViewerConnectivity.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerConnectivity.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerConnectivity.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } Mock Test-TcpConnection { $true } diff --git a/Tests/Public/Test-TeamViewerInstallation.Tests.ps1 b/Tests/Public/Test-TeamViewerInstallation.Tests.ps1 index 59ddedb..9986f4f 100644 --- a/Tests/Public/Test-TeamViewerInstallation.Tests.ps1 +++ b/Tests/Public/Test-TeamViewerInstallation.Tests.ps1 @@ -1,7 +1,7 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Get-TeamViewerInstallationDirectory.ps1" - . "$PSScriptRoot/../../docs/Cmdlets/Public/Test-TeamViewerInstallation.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Get-TeamViewerInstallationDirectory.ps1" + . "$PSScriptRoot\..\..\Cmdlets\Public\Test-TeamViewerInstallation.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } } diff --git a/Tests/Public/Unpublish-TeamViewerGroup.Tests.ps1 b/Tests/Public/Unpublish-TeamViewerGroup.Tests.ps1 index b9a96b7..53a9ab1 100644 --- a/Tests/Public/Unpublish-TeamViewerGroup.Tests.ps1 +++ b/Tests/Public/Unpublish-TeamViewerGroup.Tests.ps1 @@ -1,6 +1,6 @@ BeforeAll { - . "$PSScriptRoot/../../docs/Cmdlets/Public/Unpublish-TeamViewerGroup.ps1" - @(Get-ChildItem -Path "$PSScriptRoot/../../docs/Cmdlets/Private/*.ps1") | ` + . "$PSScriptRoot\..\..\Cmdlets\Public\Unpublish-TeamViewerGroup.ps1" + @(Get-ChildItem -Path "$PSScriptRoot\..\..\Cmdlets\Private\*.ps1") | ` ForEach-Object { . $_.FullName } $testApiToken = [securestring]@{} $null = $testApiToken diff --git a/docs/TeamViewerPS.psm1 b/docs/TeamViewerPS.psm1 deleted file mode 100644 index e373072..0000000 --- a/docs/TeamViewerPS.psm1 +++ /dev/null @@ -1,6 +0,0 @@ -$ModuleTypes = @( Get-ChildItem -Path "$PSScriptRoot/TeamViewerPS.Types.ps1" -ErrorAction SilentlyContinue ) -$PublicFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Cmdlets/Public/*.ps1" -ErrorAction SilentlyContinue ) -$PrivateFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Cmdlets/Private/*.ps1" -ErrorAction SilentlyContinue ) - -@($ModuleTypes + $PublicFunctions + $PrivateFunctions) | ForEach-Object { . $_.FullName } -Export-ModuleMember -Function $PublicFunctions.BaseName -Alias *