Skip to content

Commit

Permalink
Merge pull request #38 from karthickgandhiTV/main
Browse files Browse the repository at this point in the history
Workflow update and warning fix
  • Loading branch information
karthickgandhiTV authored Sep 20, 2023
2 parents 4d70b5d + e623de3 commit 7e62025
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 12 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@v2
- uses: actions/checkout@v3

- 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
# Include your own basic security rules. Removing this option will run all the rules
# includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
# Exclude your own basic security rules. Removing this option will run all the rules
excludeRule: '"PSUseToExportFieldsInManifest","PSAvoidGlobalVars"'
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@v2
- uses: actions/checkout@v3

- 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@v2
- uses: actions/checkout@v3

- name: Build package
shell: pwsh
Expand Down
3 changes: 0 additions & 3 deletions Tests/Public/Add-TeamViewerRoleToUserGroup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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 @@ -20,10 +19,8 @@ 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: 0 additions & 1 deletion docs/Cmdlets/Private/Get-ClientId.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ 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: 0 additions & 1 deletion docs/Cmdlets/Public/Remove-TeamViewerPSProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ 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: 0 additions & 1 deletion docs/Cmdlets/Public/Set-TeamViewerUserRole.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function Set-TeamViewerUserRole {
$body.Permissions = @($Permissions)
}
}

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

0 comments on commit 7e62025

Please sign in to comment.