Skip to content

Commit

Permalink
Revert "Merge pull request #38 from karthickgandhiTV/main"
Browse files Browse the repository at this point in the history
This reverts commit 7e62025, reversing
changes made to 4d70b5d.
  • Loading branch information
stefanhubertus committed Sep 21, 2023
1 parent f36028e commit bfb4e25
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/powershell-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: PSScriptAnalyzer
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@2044ae068e37d0161fa2127de04c19633882f061
Expand All @@ -31,8 +31,8 @@ jobs:
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
path: .\
recurse: true
# Exclude your own basic security rules. Removing this option will run all the rules
excludeRule: '"PSUseToExportFieldsInManifest","PSAvoidGlobalVars"'
# Include your own basic security rules. Removing this option will run all the rules
# includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif

# Upload the SARIF file generated in the previous step
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Build package
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Build package
shell: pwsh
Expand Down
3 changes: 3 additions & 0 deletions Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ BeforeAll {
$null = $testUserGroup
$testUserRoleId = '9b465ea2-2f75-4101-a057-58a81ed0e57b'
$null = $testUserRoleId

Mock Get-TeamViewerApiUri { '//unit.test' }
$mockArgs = @{}
Mock Invoke-TeamViewerRestMethod { $mockArgs.Body = $Body
Expand All @@ -19,8 +20,10 @@ BeforeAll {
}
}
Describe 'Add-TeamViewerRoleToUserGroup' {

It 'Should call the correct API endpoint' {
Add-TeamViewerRoleToUserGroup -ApiToken $testApiToken -UserRoleId $testUserRoleId -UserGroup $testUserGroup

Assert-MockCalled Invoke-TeamViewerRestMethod -Times 1 -Scope It -ParameterFilter {
$ApiToken -eq $testApiToken -And `
$Uri -eq '//unit.test/userroles/assign/usergroup' -And `
Expand Down
1 change: 1 addition & 0 deletions docs/Cmdlets/Private/Get-ClientId.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ function Get-ClientId {
$mainKey = Get-ItemProperty -Path 'HKLM:\Software\TeamViewer'
$id = [int]$mainKey.ClientID
}

return $id
}
2 changes: 1 addition & 1 deletion docs/Cmdlets/Public/Add-TeamViewerRoleToUserGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Add-TeamViewerRoleToUserGroup {

Begin {
$RoleId = $UserRole | Resolve-TeamViewerUserRoleId
$null = $ApiToken
$null = $ApiToken
$resourceUri = "$(Get-TeamViewerApiUri)/userroles/assign/usergroup"
$body = @{
UserRoleId = $RoleId
Expand Down
1 change: 1 addition & 0 deletions docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function Remove-TeamViewerPSProxy {

$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
Expand Down
1 change: 1 addition & 0 deletions docs/Cmdlets/Public/Set-TeamViewerUserRole.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function Set-TeamViewerUserRole {
$body.Permissions = @($Permissions)
}
}

Process {
if ($PSCmdlet.ShouldProcess($Name, 'Update User Role')) {
$response = Invoke-TeamViewerRestMethod `
Expand Down

0 comments on commit bfb4e25

Please sign in to comment.