From 98463b0c93f56873ce7055d395b3e736d390b453 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:17:24 -0600 Subject: [PATCH 01/27] feat: added github actions baseline --- .../build-test-deploy-powershell.yaml | 25 +++++++++++++++++++ azure-pipelines.yml | 20 --------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build-test-deploy-powershell.yaml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml new file mode 100644 index 00000000..e81ccc52 --- /dev/null +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -0,0 +1,25 @@ +name: PowerShell - Build Test Deploy + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + + +jobs: + build: + name: Build + runs-on: windows-latest + needs: [] + timeout-minutes: 120 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build Module + shell: pwsh + run: | + . ./build.ps1 diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 5472e2a2..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,20 +0,0 @@ -resources: - repositories: - - repository: templates - type: github - name: SCRT-HQ/AzurePipelineTemplates - endpoint: Github - -variables: -- group: deployment-vars - -trigger: - branches: - include: - - refs/heads/* - -stages: -- template: BuildTestDeployModule/azure-pipelines.yml@templates - parameters: - MkDocs: 'True' - GitUrl: 'git@github.com:scrthq/PSGSuite.git' From 465a4f7f7b00a0c4866bf3e818e3ba9dacd74620 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:20:15 -0600 Subject: [PATCH 02/27] feat: added github actions baseline --- .github/workflows/build-test-deploy-powershell.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index e81ccc52..c19af4be 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -23,3 +23,9 @@ jobs: shell: pwsh run: | . ./build.ps1 + + - name: Collect BuildOutput directory + uses: actions/upload-artifact@v4 + with: + name: BuildOutput + path: BuildOutput From d70a279253269e17a72744c0cdf5ac8c95938690 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:41:22 -0600 Subject: [PATCH 03/27] feat: added github actions baseline --- .../build-test-deploy-powershell.yaml | 63 +++++++++++++++++++ .../PSGSuite.Integration.Tests.ps1 | 32 +++++----- 2 files changed, 80 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index c19af4be..63a6356b 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -29,3 +29,66 @@ jobs: with: name: BuildOutput path: BuildOutput + + test_ubu: + name: Test Ubuntu + runs-on: ubuntu-latest + needs: + - build + timeout-minutes: 120 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download BuildOutput directory + uses: actions/download-artifact@v4 + with: + name: BuildOutput + path: BuildOutput + + - name: Test Module + shell: pwsh + run: | + . ./build.ps1 -Task Test + + test_win: + name: Test Windows + runs-on: windows-latest + needs: + - build + timeout-minutes: 120 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download BuildOutput directory + uses: actions/download-artifact@v4 + with: + name: BuildOutput + path: BuildOutput + + - name: Test Module + shell: pwsh + run: | + . ./build.ps1 -Task Test + + test_mac: + name: Test MacOS + runs-on: macos-latest + needs: + - build + timeout-minutes: 120 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download BuildOutput directory + uses: actions/download-artifact@v4 + with: + name: BuildOutput + path: BuildOutput + + - name: Test Module + shell: pwsh + run: | + . ./build.ps1 -Task Test diff --git a/Tests/3. Integration Tests/PSGSuite.Integration.Tests.ps1 b/Tests/3. Integration Tests/PSGSuite.Integration.Tests.ps1 index a699cc98..052e58de 100644 --- a/Tests/3. Integration Tests/PSGSuite.Integration.Tests.ps1 +++ b/Tests/3. Integration Tests/PSGSuite.Integration.Tests.ps1 @@ -1,22 +1,24 @@ -if ($ENV:BUILD_BUILDURI -like 'vstfs:*' -and -not [String]::IsNullOrEmpty($env:PSGSuiteConfigJson)) { - $projectRoot = Resolve-Path "$PSScriptRoot\..\.." - $ModulePath = Resolve-Path "$projectRoot\BuildOutput\$($env:BHProjectName)" - $decompiledModulePath = Resolve-Path "$projectRoot\$($env:BHProjectName)" +# if ($ENV:BUILD_BUILDURI -like 'vstfs:*' -and -not [String]::IsNullOrEmpty($env:PSGSuiteConfigJson)) { +# $projectRoot = Resolve-Path "$PSScriptRoot\..\.." +# $ModulePath = Resolve-Path "$projectRoot\BuildOutput\$($env:BHProjectName)" +# $decompiledModulePath = Resolve-Path "$projectRoot\$($env:BHProjectName)" - $Verbose = @{} - if ($ENV:BHBranchName -eq "development" -or $env:BHCommitMessage -match "!verbose") { - $Verbose.add("Verbose",$True) - } - $moduleRoot = Split-Path (Resolve-Path "$ModulePath\*\*.psd1") +# $Verbose = @{} +# if ($ENV:BHBranchName -eq "development" -or $env:BHCommitMessage -match "!verbose") { +# $Verbose.add("Verbose",$True) +# } +# $moduleRoot = Split-Path (Resolve-Path "$ModulePath\*\*.psd1") - Import-Module $ModulePath -Force -Verbose:$false - Import-PSGSuiteConfig -Json $env:PSGSuiteConfigJson -Temporary -Verbose +# Import-Module $ModulePath -Force -Verbose:$false +# Import-PSGSuiteConfig -Json $env:PSGSuiteConfigJson -Temporary -Verbose + +# $u = Get-GSUser +# $u | Select-Object @{N="GivenName";E={$_.Name.GivenName}},OrgUnitPath,Kind + +# Send-GmailMessage -From $u.PrimaryEmail -To $u.PrimaryEmail -Subject "Hello from Azure Pipelines + PS Version $($PSVersionTable.PSVersion.ToString())!" -Body "
`n$((Get-ChildItem Env: | Where-Object {$_.Name -match '^(BUILD_|BH).*$'} | Format-Table -AutoSize | Out-String).Trim())`n
" -BodyAsHtml -Verbose +# } - $u = Get-GSUser - $u | Select-Object @{N="GivenName";E={$_.Name.GivenName}},OrgUnitPath,Kind - Send-GmailMessage -From $u.PrimaryEmail -To $u.PrimaryEmail -Subject "Hello from Azure Pipelines + PS Version $($PSVersionTable.PSVersion.ToString())!" -Body "
`n$((Get-ChildItem Env: | Where-Object {$_.Name -match '^(BUILD_|BH).*$'} | Format-Table -AutoSize | Out-String).Trim())`n
" -BodyAsHtml -Verbose -} <# Describe "Function contents" -Tag 'Module' { Context "Get-GSUser should return a user" { From 727a47b333ec555285f98740a3c3fcbc07d53893 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:47:00 -0600 Subject: [PATCH 04/27] fix: tests for private function exports --- Tests/1. Module Tests/PSGSuite.Module.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/1. Module Tests/PSGSuite.Module.Tests.ps1 b/Tests/1. Module Tests/PSGSuite.Module.Tests.ps1 index 1ef97831..ed6a9b85 100644 --- a/Tests/1. Module Tests/PSGSuite.Module.Tests.ps1 +++ b/Tests/1. Module Tests/PSGSuite.Module.Tests.ps1 @@ -35,7 +35,7 @@ Describe "Module tests: $($env:BHProjectName)" -Tag 'Module' { $testCase = Get-ChildItem "$decompiledModulePath\Private" -Recurse -Include *.ps1 | Foreach-Object {@{item = $_.BaseName}} It "Should throw when checking for '' in the module commands" -TestCases $testCase { param($item) - {Get-Command -Name $item -Module $env:BHProjectName -ErrorAction Stop} | Should -Throw "The term '$item' is not recognized as the name of a cmdlet, function, script file, or operable program." + {Get-Command -Name $item -Module $env:BHProjectName -ErrorAction Stop} | Should -Throw } } Context "Confirm all aliases are created" { From 1026637a1240fd680fc71607ea135c070f307fb8 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:49:54 -0600 Subject: [PATCH 05/27] fix: tests for private function exports --- .github/workflows/build-test-deploy-powershell.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 63a6356b..e54dcdef 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -92,3 +92,11 @@ jobs: shell: pwsh run: | . ./build.ps1 -Task Test + + - name: Test Report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: NUnit Tests + path: '**/Test*.xml' + reporter: jest-junit From 64fad640bc83d6d0c500f705493bff37d5ce6577 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 15:52:36 -0600 Subject: [PATCH 06/27] removed funding yml --- .github/FUNDING.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 198776fb..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: scrthq -open_collective: # Replace with a single Open Collective username -ko_fi: scrthq -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: paypal.me/SCRTHQ From 7416764680c1c82848b6febe360631cdf09f2d6a Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:25:50 -0600 Subject: [PATCH 07/27] feat: created matrix for test execution in parallel --- .../build-test-deploy-powershell.yaml | 71 +++++-------------- 1 file changed, 18 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index e54dcdef..dd1c84b7 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -11,7 +11,7 @@ on: jobs: build: - name: Build + name: Build Module runs-on: windows-latest needs: [] timeout-minutes: 120 @@ -30,9 +30,15 @@ jobs: name: BuildOutput path: BuildOutput - test_ubu: - name: Test Ubuntu - runs-on: ubuntu-latest + test: + name: Test Module + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-latest + runs-on: ${{ matrix.os }} needs: - build timeout-minutes: 120 @@ -46,57 +52,16 @@ jobs: name: BuildOutput path: BuildOutput - - name: Test Module + - name: Test Module - ${{ matrix.os }} shell: pwsh run: | . ./build.ps1 -Task Test - test_win: - name: Test Windows - runs-on: windows-latest - needs: - - build - timeout-minutes: 120 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download BuildOutput directory - uses: actions/download-artifact@v4 - with: - name: BuildOutput - path: BuildOutput - - - name: Test Module - shell: pwsh - run: | - . ./build.ps1 -Task Test - - test_mac: - name: Test MacOS - runs-on: macos-latest - needs: - - build - timeout-minutes: 120 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download BuildOutput directory - uses: actions/download-artifact@v4 - with: - name: BuildOutput - path: BuildOutput - - - name: Test Module - shell: pwsh - run: | - . ./build.ps1 -Task Test - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() + - name: Collect Test Result - ${{ matrix.os }} + id: test_result + uses: zyborg/pester-tests-report@v1 with: - name: NUnit Tests - path: '**/Test*.xml' - reporter: jest-junit + test_results_path: TestResults.xml + report_name: test_result + report_title: Test Results - ${{ matrix.os }} + github_token: ${{ secrets.GITHUB_TOKEN }} From 9693b1ef9090e8022a6d7ea079b77af9a4da3c10 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:29:18 -0600 Subject: [PATCH 08/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index dd1c84b7..608d3e8c 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -61,7 +61,7 @@ jobs: id: test_result uses: zyborg/pester-tests-report@v1 with: - test_results_path: TestResults.xml + test_results_path: BuildOutput/TestResults.xml report_name: test_result report_title: Test Results - ${{ matrix.os }} github_token: ${{ secrets.GITHUB_TOKEN }} From e129b4b895dc9e123823a204604b210fff17c548 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:29:32 -0600 Subject: [PATCH 09/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 608d3e8c..04965f47 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -33,6 +33,7 @@ jobs: test: name: Test Module strategy: + fail-fast: false matrix: os: - ubuntu-latest From 4e490db9fafa10cdc6b997fbbfcfbe4b4690db51 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:35:33 -0600 Subject: [PATCH 10/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 04965f47..def24410 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -65,4 +65,5 @@ jobs: test_results_path: BuildOutput/TestResults.xml report_name: test_result report_title: Test Results - ${{ matrix.os }} + skip_check_run: true github_token: ${{ secrets.GITHUB_TOKEN }} From 3a653f3f24cfd3035ec271d4282acbd5b035300c Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:49:13 -0600 Subject: [PATCH 11/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index def24410..b9904ea8 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -58,9 +58,19 @@ jobs: run: | . ./build.ps1 -Task Test + - name: Test Report - ${{ matrix.os }} + uses: dorny/test-reporter@v1 + if: success() || failure() + continue-on-error: true + with: + name: Pester Tests - ${{ matrix.os }} + path: '**/Test*.xml' + reporter: java-junit + - name: Collect Test Result - ${{ matrix.os }} id: test_result uses: zyborg/pester-tests-report@v1 + continue-on-error: true with: test_results_path: BuildOutput/TestResults.xml report_name: test_result From 68b381cee493c9203c1f1ea277f6902b3181ffbe Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:53:24 -0600 Subject: [PATCH 12/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index b9904ea8..d204be77 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -58,15 +58,6 @@ jobs: run: | . ./build.ps1 -Task Test - - name: Test Report - ${{ matrix.os }} - uses: dorny/test-reporter@v1 - if: success() || failure() - continue-on-error: true - with: - name: Pester Tests - ${{ matrix.os }} - path: '**/Test*.xml' - reporter: java-junit - - name: Collect Test Result - ${{ matrix.os }} id: test_result uses: zyborg/pester-tests-report@v1 From c61c21e2656ca82e9bae5df9177e2ab046b18fa7 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Thu, 11 Jan 2024 23:55:36 -0600 Subject: [PATCH 13/27] feat: created matrix for test execution in parallel --- PSGSuite/PSGSuite.psd1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PSGSuite/PSGSuite.psd1 b/PSGSuite/PSGSuite.psd1 index af23d76c..865b7a2b 100644 --- a/PSGSuite/PSGSuite.psd1 +++ b/PSGSuite/PSGSuite.psd1 @@ -12,7 +12,7 @@ RootModule = 'PSGSuite.psm1' # Version number of this module. - ModuleVersion = '2.36.6' + ModuleVersion = '2.37.0' # ID used to uniquely identify this module GUID = '9d751152-e83e-40bb-a6db-4c329092aaec' @@ -24,7 +24,7 @@ CompanyName = 'SCRT HQ' # Copyright statement for this module - Copyright = '(c) SCRT HQ 2016-2019. All rights reserved.' + Copyright = '(c) SCRT HQ 2016-2024. All rights reserved.' # Description of the functionality provided by this module Description = "PSGSuite is a Powershell module wrapping Google's .NET SDKs in handy functions, enabling users perform tasks as large as G Suite SuperAdmins automating the administration of their multi-domain G Suite accounts down to free, Google account users sending Gmail messages or uploading content to Drive from home." @@ -98,10 +98,10 @@ Tags = 'GSuite', 'Google', 'Apps', 'API', 'Drive', 'Gmail', 'Admin', 'Automation', 'PSEdition_Core', 'PSEdition_Desktop', 'Windows', 'Linux', 'Mac' # A URL to the license for this module. - LicenseUri = 'https://github.com/scrthq/PSGSuite/blob/master/LICENSE' + LicenseUri = 'https://github.com/SCRT-HQ/PSGSuite/blob/master/LICENSE' # A URL to the main website for this project. - ProjectUri = 'https://github.com/scrthq/PSGSuite' + ProjectUri = 'https://github.com/SCRT-HQ/PSGSuite' # A URL to an icon representing this module. IconUri = 'http://centerlyne.com/wp-content/uploads/2016/10/Google_-G-_Logo.svg_.png' @@ -117,7 +117,7 @@ } # End of PrivateData hashtable # HelpInfo URI of this module - # HelpInfoURI = 'https://github.com/scrthq/PSGSuite/wiki' + # HelpInfoURI = 'https://github.com/SCRT-HQ/PSGSuite/wiki' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' From ef986e7005adb6257fbfbce7255ab7ba77379d11 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 00:01:27 -0600 Subject: [PATCH 14/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index d204be77..3fc352f8 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -39,6 +39,7 @@ jobs: - ubuntu-latest - windows-latest - macos-latest + - windows-2022 runs-on: ${{ matrix.os }} needs: - build @@ -54,7 +55,7 @@ jobs: path: BuildOutput - name: Test Module - ${{ matrix.os }} - shell: pwsh + shell: "${{ matrix.os == 'windows-2022' && 'powershell' || 'pwsh' }}" run: | . ./build.ps1 -Task Test From 5a98af82c0ab755880f681d4ef74a08c715deac5 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 00:04:31 -0600 Subject: [PATCH 15/27] feat: created matrix for test execution in parallel --- .github/workflows/build-test-deploy-powershell.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 3fc352f8..e9c3ed15 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -44,6 +44,8 @@ jobs: needs: - build timeout-minutes: 120 + env: + TEST_SHELL: ${{ matrix.os == 'windows-2022' && 'powershell' || 'pwsh' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -54,8 +56,15 @@ jobs: name: BuildOutput path: BuildOutput - - name: Test Module - ${{ matrix.os }} - shell: "${{ matrix.os == 'windows-2022' && 'powershell' || 'pwsh' }}" + - name: Test Module - pwsh (${{ matrix.os }}) + shell: pwsh + if: ${{ matrix.os != 'windows-2022' }} + run: | + . ./build.ps1 -Task Test + + - name: Test Module - PowerShell (${{ matrix.os }}) + shell: powershell + if: ${{ matrix.os == 'windows-2022' }} run: | . ./build.ps1 -Task Test From 5d7b185a9002d8408d4d062c1e552000c3e47b79 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 00:10:33 -0600 Subject: [PATCH 16/27] chore: cleaned up test job details, investigating failing tests on Windows PowerShell to see if actionable --- .github/workflows/build-test-deploy-powershell.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index e9c3ed15..a45abceb 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -32,6 +32,8 @@ jobs: test: name: Test Module + needs: + - build strategy: fail-fast: false matrix: @@ -41,11 +43,7 @@ jobs: - macos-latest - windows-2022 runs-on: ${{ matrix.os }} - needs: - - build timeout-minutes: 120 - env: - TEST_SHELL: ${{ matrix.os == 'windows-2022' && 'powershell' || 'pwsh' }} steps: - name: Checkout uses: actions/checkout@v4 From f72f762fa7d1d16e5b695035bec7fbce7a12030e Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 00:14:44 -0600 Subject: [PATCH 17/27] chore: cleaned up test job details, investigating failing tests on Windows PowerShell to see if actionable --- .github/workflows/build-test-deploy-powershell.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index a45abceb..bad227de 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - name: Build Module - shell: pwsh + shell: powershell run: | . ./build.ps1 From e2505b667cc0085e382447f20bc2d0b1bd45afbf Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 00:16:50 -0600 Subject: [PATCH 18/27] chore: cleaned up test job details, investigating failing tests on Windows PowerShell to see if actionable --- .github/workflows/build-test-deploy-powershell.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index bad227de..edc565f5 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - name: Build Module - shell: powershell + shell: pwsh run: | . ./build.ps1 @@ -63,6 +63,7 @@ jobs: - name: Test Module - PowerShell (${{ matrix.os }}) shell: powershell if: ${{ matrix.os == 'windows-2022' }} + continue-on-error: true run: | . ./build.ps1 -Task Test From 3c6b4615863ffe8cfd3da664891031cd1242bbaf Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 18:43:40 -0600 Subject: [PATCH 19/27] chore: updated github actions test collector --- .../build-test-deploy-powershell.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index edc565f5..6c833576 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -8,6 +8,11 @@ on: branches: - '*' +permissions: + contents: read + issues: read + checks: write + pull-requests: write jobs: build: @@ -67,13 +72,11 @@ jobs: run: | . ./build.ps1 -Task Test - - name: Collect Test Result - ${{ matrix.os }} - id: test_result - uses: zyborg/pester-tests-report@v1 + - name: Publish Test Results - ${{ matrix.os }} + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + if: always() continue-on-error: true with: - test_results_path: BuildOutput/TestResults.xml - report_name: test_result - report_title: Test Results - ${{ matrix.os }} - skip_check_run: true - github_token: ${{ secrets.GITHUB_TOKEN }} + check_name: Test Results - ${{ matrix.os }} + files: | + BuildOutput/TestResults.xml \ No newline at end of file From 8bc3e62f0d8d525944aa0c2cc9d9f05303a07aa5 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 18:57:43 -0600 Subject: [PATCH 20/27] chore: updated CODEOWNERS --- .github/workflows/build-test-deploy-powershell.yaml | 2 +- CODEOWNERS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 6c833576..eb449153 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -79,4 +79,4 @@ jobs: with: check_name: Test Results - ${{ matrix.os }} files: | - BuildOutput/TestResults.xml \ No newline at end of file + BuildOutput/TestResults.xml diff --git a/CODEOWNERS b/CODEOWNERS index 7e330601..c402c50b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1,2 @@ azure-pipelines.yml @scrthq +.github/workflows/** @scrthq From cfaa5990e654cffe4575405debfb630f1720cf1d Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Fri, 12 Jan 2024 18:59:58 -0600 Subject: [PATCH 21/27] chore: updated CODEOWNERS --- CODEOWNERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index c402c50b..e007d9d7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,6 @@ +# General approvers/owners +* @scrthq @jgeron-suhsd + +# Pipeline / CI/CD files azure-pipelines.yml @scrthq .github/workflows/** @scrthq From 72ab396cafbe798dc06f21e8c57bd36ba29a6b56 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Sat, 13 Jan 2024 16:41:33 -0600 Subject: [PATCH 22/27] fix: reorder net45 imports to restore WindowsPowerShell build --- .../build-test-deploy-powershell.yaml | 2 +- PSGSuite/Private/Import-GoogleSDK.ps1 | 19 +++++++++++++------ psake.ps1 | 4 ---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index eb449153..0fd1596c 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -68,7 +68,7 @@ jobs: - name: Test Module - PowerShell (${{ matrix.os }}) shell: powershell if: ${{ matrix.os == 'windows-2022' }} - continue-on-error: true + # continue-on-error: true run: | . ./build.ps1 -Task Test diff --git a/PSGSuite/Private/Import-GoogleSDK.ps1 b/PSGSuite/Private/Import-GoogleSDK.ps1 index c8271ede..0927e0fb 100644 --- a/PSGSuite/Private/Import-GoogleSDK.ps1 +++ b/PSGSuite/Private/Import-GoogleSDK.ps1 @@ -4,7 +4,7 @@ function Import-GoogleSDK { Process { $lib = Resolve-Path "$($script:ModuleRoot)\lib" $refs = @() - $sdkPath = if ($PSVersionTable.PSVersion.Major -lt 6) { + $sdkPath = if ($PSVersionTable.PSVersion.Major -le 5) { Write-Verbose "Importing the SDK's for net45" "$lib\net45" } @@ -13,26 +13,33 @@ function Import-GoogleSDK { "$lib\netstandard1.3" } $dlls = Get-ChildItem $sdkPath -Filter "*.dll" - $googleCore = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.dll'}) + $specialGoogleDlls = @('Google.Apis.Auth.dll', 'Google.Apis.Core.dll', 'Google.Apis.dll') + $googleCore = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.Core.dll'}) + $googleApis = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.dll'}) + $googleAuth = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.Auth.dll'}) $googleCoreVersion = [System.Version]((Get-Item $googleCore.FullName).VersionInfo.FileVersion) $batches = @( # Load the non-Google DLLs first... ($dlls | Where-Object {$_.Name -notin $refs -and $_.Name -notmatch '^Google'}) - # Then load Google.Apis.dll... + # Then load Google.Apis.Core.dll... $googleCore + # Then load Google.Apis.dll... + $googleApis + # Then load Google.Apis.Auth.dll... + $googleAuth # Then load the rest of the Google DLLs - ($dlls | Where-Object {$_.Name -notin $refs -and $_.Name -match '^Google' -and $_.Name -ne 'Google.Apis.dll'}) + ($dlls | Where-Object {$_.Name -notin $refs -and $_.Name -match '^Google' -and $_.Name -notin $specialGoogleDlls}) ) foreach ($batch in $batches) { $batch | ForEach-Object { $sdk = $_.Name try { $params = @{} - if ($_.Name -match '^Google' -and $_.Name -ne 'Google.Apis.dll' -and ([System.Version]((Get-Item $_.FullName).VersionInfo.FileVersion)) -ge $googleCoreVersion) { + if ($_.Name -match '^Google' -and $_.Name -notin $specialGoogleDlls -and ([System.Version]((Get-Item $_.FullName).VersionInfo.FileVersion)) -ge $googleCoreVersion) { $params['ReferencedAssemblies'] = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.dll'}).FullName Add-Type -Path $_.FullName @params -ErrorAction Stop } - elseif ($_.Name -notmatch '^Google' -or $_.Name -eq 'Google.Apis.dll' -or ($_.Name -ne 'Google.Apis.dll' -and ([System.Version]((Get-Item $_.FullName).VersionInfo.FileVersion)) -ge $googleCoreVersion)) { + elseif ($_.Name -notmatch '^Google' -or $_.Name -eq 'Google.Apis.dll' -or ($_.Name -notin $specialGoogleDlls -and ([System.Version]((Get-Item $_.FullName).VersionInfo.FileVersion)) -ge $googleCoreVersion)) { Add-Type -Path $_.FullName @params -ErrorAction Stop } } diff --git a/psake.ps1 b/psake.ps1 index 7758dff7..2a72986b 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -346,10 +346,6 @@ $pesterScriptBlock = { MinimumVersion = '4.10.1' MaximumVersion = '4.99.99' } - @{ - Name = 'Assert' - MinimumVersion = '0.9.5' - } ) foreach ($module in $dependencies) { Write-BuildLog "[$($module.Name)] Resolving" From 00c119c10eb895605c1b44312ec436aa1be7ac79 Mon Sep 17 00:00:00 2001 From: Jesse Geron Date: Thu, 14 Mar 2024 14:46:47 -0700 Subject: [PATCH 23/27] Try -global param on import-module for Pester to resolve safegetcommand error --- psake.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psake.ps1 b/psake.ps1 index 2a72986b..e06935d2 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -359,7 +359,7 @@ $pesterScriptBlock = { catch { Write-BuildLog "[$($module.Name)] Installing missing module" Install-Module @module -Repository PSGallery -Force - Import-Module @module + Import-Module @module -Global } } Push-Location From 11f67cb4061eec52e1fe85b4162a0d17cd58e947 Mon Sep 17 00:00:00 2001 From: Jesse Geron Date: Thu, 14 Mar 2024 15:05:52 -0700 Subject: [PATCH 24/27] remove global param --- psake.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psake.ps1 b/psake.ps1 index e06935d2..2a72986b 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -359,7 +359,7 @@ $pesterScriptBlock = { catch { Write-BuildLog "[$($module.Name)] Installing missing module" Install-Module @module -Repository PSGallery -Force - Import-Module @module -Global + Import-Module @module } } Push-Location From 545b095435c8e6be408009d7cb212e282404a282 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Wed, 13 Nov 2024 14:02:51 -0600 Subject: [PATCH 25/27] chore: adjusted minimum version of PowerShell to 5.1 --- PSGSuite/PSGSuite.psd1 | 2 +- psake.ps1 | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/PSGSuite/PSGSuite.psd1 b/PSGSuite/PSGSuite.psd1 index 865b7a2b..f6e1f733 100644 --- a/PSGSuite/PSGSuite.psd1 +++ b/PSGSuite/PSGSuite.psd1 @@ -30,7 +30,7 @@ Description = "PSGSuite is a Powershell module wrapping Google's .NET SDKs in handy functions, enabling users perform tasks as large as G Suite SuperAdmins automating the administration of their multi-domain G Suite accounts down to free, Google account users sending Gmail messages or uploading content to Drive from home." # Minimum version of the Windows PowerShell engine required by this module - PowerShellVersion = '4.0' + PowerShellVersion = '5.1' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' diff --git a/psake.ps1 b/psake.ps1 index 2a72986b..ae531bf7 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -532,7 +532,7 @@ $deployScriptBlock = { # Bump the module version if ($versionToDeploy) { try { - if ($ENV:BHBuildSystem -eq 'VSTS' -and -not [String]::IsNullOrEmpty($env:NugetApiKey)) { + if ([String]::IsNullOrEmpty($env:NugetApiKey)) { " Publishing version [$($versionToDeploy)] to PSGallery..." Update-Metadata -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1") -PropertyName ModuleVersion -Value $versionToDeploy Publish-Module -Path $outputModVerDir -NuGetApiKey $env:NugetApiKey -Repository PSGallery @@ -542,24 +542,24 @@ $deployScriptBlock = { " [SKIPPED] Deployment of version [$($versionToDeploy)] to PSGallery" } $commitId = git rev-parse --verify HEAD - if ($ENV:BHBuildSystem -eq 'VSTS' -and -not [String]::IsNullOrEmpty($env:TwitterAccessSecret) -and -not [String]::IsNullOrEmpty($env:TwitterAccessToken) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerKey) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerSecret)) { - " Publishing tweet about new release..." - $manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1") - $text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell" - $manifest.PrivateData.PSData.Tags | Foreach-Object { - $text += " #$($_)" - } - if ($text.Length -gt 280) { - " Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..." - $text = $text.Substring(0,280) - } - " Tweet text: $text" - Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret - " Tweet successful!" - } - else { - " [SKIPPED] Twitter update of new release" - } + # if ($ENV:BHBuildSystem -eq 'VSTS' -and -not [String]::IsNullOrEmpty($env:TwitterAccessSecret) -and -not [String]::IsNullOrEmpty($env:TwitterAccessToken) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerKey) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerSecret)) { + # " Publishing tweet about new release..." + # $manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1") + # $text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell" + # $manifest.PrivateData.PSData.Tags | Foreach-Object { + # $text += " #$($_)" + # } + # if ($text.Length -gt 280) { + # " Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..." + # $text = $text.Substring(0,280) + # } + # " Tweet text: $text" + # Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret + # " Tweet successful!" + # } + # else { + # " [SKIPPED] Twitter update of new release" + # } if (-not [String]::IsNullOrEmpty($env:GitHubPAT)) { " Creating Release ZIP..." $zipPath = [System.IO.Path]::Combine($PSScriptRoot,"$($env:BHProjectName).zip") From e2ebb86e6b6f00dc00a9af5600bf3094d881c245 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Wed, 13 Nov 2024 17:15:07 -0600 Subject: [PATCH 26/27] chore: updated minimum PS version to 6.0 due to increased requirements from Google .NET SDKs --- .../build-test-deploy-powershell.yaml | 9 - CHANGELOG.md | 229 +++++++++--------- PSGSuite/PSGSuite.psd1 | 6 +- PSGSuite/Private/Import-GoogleSDK.ps1 | 17 +- README.md | 8 + Tests/1. Module Tests/PSGSuite.Help.Tests.ps1 | 13 +- ci/AzurePipelinesHelpers.ps1 | 17 +- ci/UpdateNuGetDependenciesJson.ps1 | 2 +- 8 files changed, 157 insertions(+), 144 deletions(-) diff --git a/.github/workflows/build-test-deploy-powershell.yaml b/.github/workflows/build-test-deploy-powershell.yaml index 0fd1596c..2f4d9cbb 100644 --- a/.github/workflows/build-test-deploy-powershell.yaml +++ b/.github/workflows/build-test-deploy-powershell.yaml @@ -46,7 +46,6 @@ jobs: - ubuntu-latest - windows-latest - macos-latest - - windows-2022 runs-on: ${{ matrix.os }} timeout-minutes: 120 steps: @@ -61,14 +60,6 @@ jobs: - name: Test Module - pwsh (${{ matrix.os }}) shell: pwsh - if: ${{ matrix.os != 'windows-2022' }} - run: | - . ./build.ps1 -Task Test - - - name: Test Module - PowerShell (${{ matrix.os }}) - shell: powershell - if: ${{ matrix.os == 'windows-2022' }} - # continue-on-error: true run: | . ./build.ps1 -Task Test diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a223835..ec2703b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,118 +1,127 @@ -* [PSGSuite - ChangeLog](#psgsuite---changelog) - * [2.36.6 - 2021-06-06](#2366---2021-06-06) - * [2.36.5 - 2020-11-01](#2365---2020-11-01) - * [2.36.4 - 2020-03-20](#2364---2020-03-20) - * [2.36.3 - 2020-03-20](#2363---2020-03-20) - * [2.36.2 - 2020-03-02](#2362---2020-03-02) - * [2.36.1 - 2020-03-02](#2361---2020-03-02) - * [2.36.0 - 2020-02-28](#2360---2020-02-28) - * [2.35.1 - 2019-12-29](#2351---2019-12-29) - * [2.35.0 - 2019-12-29](#2350---2019-12-29) - * [2.34.0 - 2019-11-02](#2340---2019-11-02) - * [2.33.2 - 2019-10-06](#2332---2019-10-06) - * [2.33.1 - 2019-10-06](#2331---2019-10-06) - * [2.33.0 - 2019-09-26](#2330---2019-09-26) - * [2.32.3 - 2019-09-18](#2323---2019-09-18) - * [2.32.2 - 2019-09-15](#2322---2019-09-15) - * [2.32.1 - 2019-09-14](#2321---2019-09-14) - * [2.32.0 - 2019-09-12](#2320---2019-09-12) - * [2.31.1 - 2019-08-30](#2311---2019-08-30) - * [2.31.0](#2310) - * [2.30.2](#2302) - * [2.30.1](#2301) - * [2.30.0](#2300) - * [2.29.0](#2290) - * [2.28.2](#2282) - * [2.28.1](#2281) - * [2.28.0](#2280) - * [2.27.0](#2270) - * [2.26.4](#2264) - * [2.26.3](#2263) - * [2.26.2](#2262) - * [2.26.1](#2261) - * [2.26.0](#2260) - * [2.25.3](#2253) - * [2.25.2](#2252) - * [2.25.1](#2251) - * [2.25.0](#2250) - * [2.24.0](#2240) - * [2.23.2](#2232) - * [2.23.1](#2231) - * [2.23.0](#2230) - * [2.22.4](#2224) - * [2.22.3](#2223) - * [2.22.2](#2222) - * [2.22.1](#2221) - * [2.22.0](#2220) - * [2.21.3](#2213) - * [2.21.2](#2212) - * [2.21.1](#2211) - * [2.21.0](#2210) - * [2.20.2](#2202) - * [2.20.1](#2201) - * [2.20.0](#2200) - * [2.19.0](#2190) - * [2.18.1](#2181) - * [2.18.0](#2180) - * [2.17.2](#2172) - * [2.17.1](#2171) - * [2.17.0](#2170) - * [2.16.1](#2161) - * [2.16.0](#2160) - * [2.15.4](#2154) - * [2.15.3](#2153) - * [2.15.2](#2152) - * [2.15.1](#2151) - * [2.15.0](#2150) - * [2.14.1](#2141) - * [2.14.0](#2140) - * [2.13.2](#2132) - * [2.13.1](#2131) - * [2.13.0](#2130) - * [2.12.1](#2121) - * [2.12.0](#2120) - * [2.11.0](#2110) - * [2.10.2](#2102) - * [2.10.1](#2101) - * [2.10.0](#2100) - * [2.9.0](#290) - * [2.8.1](#281) - * [2.8.0](#280) - * [2.7.2](#272) - * [2.7.1](#271) - * [2.7.0](#270) - * [2.6.3](#263) - * [2.6.2](#262) - * [2.6.1](#261) - * [2.6.0](#260) - * [2.5.4](#254) - * [2.5.3](#253) - * [2.5.2](#252) - * [2.5.1](#251) - * [2.5.0](#250) - * [2.4.0](#240) - * [2.3.0](#230) - * [2.2.1](#221) - * [2.2.0](#220) - * [2.1.5](#215) - * [2.1.3 / 2.1.4](#213--214) - * [2.1.2](#212) - * [2.1.1](#211) - * [2.1.0](#210) - * [2.0.3](#203) - * [2.0.2](#202) - * [2.0.1](#201) - * [2.0.0](#200) - * [New Functionality](#new-functionality) - * [Breaking Changes in 2.0.0](#breaking-changes-in-200) - * [Gmail Delegation Management Removed](#gmail-delegation-management-removed) - * [Functions Removed](#functions-removed) - * [Functions Aliased](#functions-aliased) +- [3.0.0 - 2024-11-20](#300---2024-11-20) + - [BREAKING CHANGES](#breaking-changes) +- [2.36.6 - 2021-06-06](#2366---2021-06-06) +- [2.36.5 - 2020-11-01](#2365---2020-11-01) +- [2.36.4 - 2020-03-20](#2364---2020-03-20) +- [2.36.3 - 2020-03-20](#2363---2020-03-20) +- [2.36.2 - 2020-03-02](#2362---2020-03-02) +- [2.36.1 - 2020-03-02](#2361---2020-03-02) +- [2.36.0 - 2020-02-28](#2360---2020-02-28) +- [2.35.1 - 2019-12-29](#2351---2019-12-29) +- [2.35.0 - 2019-12-29](#2350---2019-12-29) +- [2.34.0 - 2019-11-02](#2340---2019-11-02) +- [2.33.2 - 2019-10-06](#2332---2019-10-06) +- [2.33.1 - 2019-10-06](#2331---2019-10-06) +- [2.33.0 - 2019-09-26](#2330---2019-09-26) +- [2.32.3 - 2019-09-18](#2323---2019-09-18) +- [2.32.2 - 2019-09-15](#2322---2019-09-15) +- [2.32.1 - 2019-09-14](#2321---2019-09-14) +- [2.32.0 - 2019-09-12](#2320---2019-09-12) +- [2.31.1 - 2019-08-30](#2311---2019-08-30) +- [2.31.0](#2310) +- [2.30.2](#2302) +- [2.30.1](#2301) +- [2.30.0](#2300) +- [2.29.0](#2290) +- [2.28.2](#2282) +- [2.28.1](#2281) +- [2.28.0](#2280) +- [2.27.0](#2270) +- [2.26.4](#2264) +- [2.26.3](#2263) +- [2.26.2](#2262) +- [2.26.1](#2261) +- [2.26.0](#2260) +- [2.25.3](#2253) +- [2.25.2](#2252) +- [2.25.1](#2251) +- [2.25.0](#2250) +- [2.24.0](#2240) +- [2.23.2](#2232) +- [2.23.1](#2231) +- [2.23.0](#2230) +- [2.22.4](#2224) +- [2.22.3](#2223) +- [2.22.2](#2222) +- [2.22.1](#2221) +- [2.22.0](#2220) +- [2.21.3](#2213) +- [2.21.2](#2212) +- [2.21.1](#2211) +- [2.21.0](#2210) +- [2.20.2](#2202) +- [2.20.1](#2201) +- [2.20.0](#2200) +- [2.19.0](#2190) +- [2.18.1](#2181) +- [2.18.0](#2180) +- [2.17.2](#2172) +- [2.17.1](#2171) +- [2.17.0](#2170) +- [2.16.1](#2161) +- [2.16.0](#2160) +- [2.15.4](#2154) +- [2.15.3](#2153) +- [2.15.2](#2152) +- [2.15.1](#2151) +- [2.15.0](#2150) +- [2.14.1](#2141) +- [2.14.0](#2140) +- [2.13.2](#2132) +- [2.13.1](#2131) +- [2.13.0](#2130) +- [2.12.1](#2121) +- [2.12.0](#2120) +- [2.11.0](#2110) +- [2.10.2](#2102) +- [2.10.1](#2101) +- [2.10.0](#2100) +- [2.9.0](#290) +- [2.8.1](#281) +- [2.8.0](#280) +- [2.7.2](#272) +- [2.7.1](#271) +- [2.7.0](#270) +- [2.6.3](#263) +- [2.6.2](#262) +- [2.6.1](#261) +- [2.6.0](#260) +- [2.5.4](#254) +- [2.5.3](#253) +- [2.5.2](#252) +- [2.5.1](#251) +- [2.5.0](#250) +- [2.4.0](#240) +- [2.3.0](#230) +- [2.2.1](#221) +- [2.2.0](#220) +- [2.1.5](#215) +- [2.1.3 / 2.1.4](#213--214) +- [2.1.2](#212) +- [2.1.1](#211) +- [2.1.0](#210) +- [2.0.3](#203) +- [2.0.2](#202) +- [2.0.1](#201) +- [2.0.0](#200) + - [New Functionality](#new-functionality) + - [Breaking Changes in 2.0.0](#breaking-changes-in-200) + - [Gmail Delegation Management Removed](#gmail-delegation-management-removed) + - [Functions Removed](#functions-removed) + - [Functions Aliased](#functions-aliased) *** # PSGSuite - ChangeLog +## 3.0.0 - 2024-11-20 + +### BREAKING CHANGES + +- Increased minimum PowerShell version to 6.0 + - Necessary due to deprecation of support for .NET Framework 4.5 within the `Google.Apis.*` .NET assemblies used throughout PSGSuite +- Restored release capabilities within the backing repository after adding additional owner ([@jgeron-suhsd](https://github.com/jgeron-suhsd)) + ## 2.36.6 - 2021-06-06 * [Issue #344](https://github.com/SCRT-HQ/PSGSuite/issues/344) diff --git a/PSGSuite/PSGSuite.psd1 b/PSGSuite/PSGSuite.psd1 index f6e1f733..3584704b 100644 --- a/PSGSuite/PSGSuite.psd1 +++ b/PSGSuite/PSGSuite.psd1 @@ -12,7 +12,7 @@ RootModule = 'PSGSuite.psm1' # Version number of this module. - ModuleVersion = '2.37.0' + ModuleVersion = '3.0.0' # ID used to uniquely identify this module GUID = '9d751152-e83e-40bb-a6db-4c329092aaec' @@ -30,7 +30,7 @@ Description = "PSGSuite is a Powershell module wrapping Google's .NET SDKs in handy functions, enabling users perform tasks as large as G Suite SuperAdmins automating the administration of their multi-domain G Suite accounts down to free, Google account users sending Gmail messages or uploading content to Drive from home." # Minimum version of the Windows PowerShell engine required by this module - PowerShellVersion = '5.1' + PowerShellVersion = '6.0' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' @@ -95,7 +95,7 @@ # Prerelease = '-alpha' # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'GSuite', 'Google', 'Apps', 'API', 'Drive', 'Gmail', 'Admin', 'Automation', 'PSEdition_Core', 'PSEdition_Desktop', 'Windows', 'Linux', 'Mac' + Tags = 'GSuite', 'Google', 'Apps', 'API', 'Drive', 'Gmail', 'Admin', 'Automation', 'PSEdition_Core', 'Windows', 'Linux', 'Mac' # A URL to the license for this module. LicenseUri = 'https://github.com/SCRT-HQ/PSGSuite/blob/master/LICENSE' diff --git a/PSGSuite/Private/Import-GoogleSDK.ps1 b/PSGSuite/Private/Import-GoogleSDK.ps1 index 0927e0fb..2baccadd 100644 --- a/PSGSuite/Private/Import-GoogleSDK.ps1 +++ b/PSGSuite/Private/Import-GoogleSDK.ps1 @@ -4,14 +4,15 @@ function Import-GoogleSDK { Process { $lib = Resolve-Path "$($script:ModuleRoot)\lib" $refs = @() - $sdkPath = if ($PSVersionTable.PSVersion.Major -le 5) { - Write-Verbose "Importing the SDK's for net45" - "$lib\net45" - } - else { - Write-Verbose "Importing the SDK's for netstandard1.3" - "$lib\netstandard1.3" - } + $sdkPath = $lib + # $sdkPath = if ($PSVersionTable.PSVersion.Major -le 5) { + # Write-Verbose "Importing the SDK's for net45" + # "$lib\net45" + # } + # else { + # Write-Verbose "Importing the SDK's for netstandard1.3" + # "$lib\netstandard1.3" + # } $dlls = Get-ChildItem $sdkPath -Filter "*.dll" $specialGoogleDlls = @('Google.Apis.Auth.dll', 'Google.Apis.Core.dll', 'Google.Apis.dll') $googleCore = ($dlls | Where-Object {$_.Name -eq 'Google.Apis.Core.dll'}) diff --git a/README.md b/README.md index 243017a3..706078db 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ # PSGSuite + +## IMPORTANT - PSGSUITE 3.0.0+ REQUIRES POWERSHELL 6.0+ + +This is a breaking change introduced with PSGSuite 3.0.0. Please see the +[CHANGELOG](./CHANGELOG.md) for more information. + +--- +
PSGSuite 2.0.0 released!
diff --git a/Tests/1. Module Tests/PSGSuite.Help.Tests.ps1 b/Tests/1. Module Tests/PSGSuite.Help.Tests.ps1 index ff862563..97a0564b 100644 --- a/Tests/1. Module Tests/PSGSuite.Help.Tests.ps1 +++ b/Tests/1. Module Tests/PSGSuite.Help.Tests.ps1 @@ -7,12 +7,13 @@ Describe "Public Function Help tests" { # Adapted from Francois' post here: https://lazywinadmin.com/2016/05/using-pester-to-test-your-comment-based.html Import-Module "$TargetModulePath\$($ModuleName).psd1" -Force -ErrorAction SilentlyContinue # Make sure the assemblies are present in the current scope otherwise function help will fail - $dllFolder = if ($PSVersionTable.PSVersion.Major -le 5) { - [System.IO.Path]::Combine($TargetModulePath,'lib','net45') - } - else { - [System.IO.Path]::Combine($TargetModulePath,'lib','netstandard1.3') - } + $dllFolder = [System.IO.Path]::Combine($TargetModulePath,'lib') + # $dllFolder = if ($PSVersionTable.PSVersion.Major -le 5) { + # [System.IO.Path]::Combine($TargetModulePath,'lib','net45') + # } + # else { + # [System.IO.Path]::Combine($TargetModulePath,'lib','netstandard1.3') + # } Get-ChildItem $dllFolder -Filter '*.dll' -Recurse | ForEach-Object { Add-Type -Path $_.FullName -IgnoreWarnings } diff --git a/ci/AzurePipelinesHelpers.ps1 b/ci/AzurePipelinesHelpers.ps1 index 23bbbda0..8052a053 100644 --- a/ci/AzurePipelinesHelpers.ps1 +++ b/ci/AzurePipelinesHelpers.ps1 @@ -51,8 +51,8 @@ function Install-NuGetDependencies { TagId = $inst.BaseName + '#' + $inst.LatestVersion } } - Write-BuildLog ("[{0}.{1}] Downloading latest package from NuGet" -f $pkg.Name,$pkg.Version) $extPath = [System.IO.Path]::Combine($dllStgPath,"$($pkg.Name.ToLower().TrimEnd('.dll')).$($pkg.Version)") + Write-BuildLog ("[{0}.{1}] Downloading latest package from NuGet to path: {2}" -f $pkg.Name,$pkg.Version,$extPath) if (Test-Path ($extPath)) { Remove-Item $extPath -Recurse -Force } @@ -77,8 +77,9 @@ function Install-NuGetDependencies { Add-Type -AssemblyName System.IO.Compression [System.IO.Compression.ZipFile]::ExtractToDirectory($zipPath,$extPath) foreach ($dest in $Destination) { - foreach ($target in @('net45','netstandard1.3')) { - $targetPath = [System.IO.Path]::Combine($dest,'lib',$target) + $destFound = $false + foreach ($target in @('netstandard1.3','netstandard2.0')) { + $targetPath = [System.IO.Path]::Combine($dest,'lib') if (-not (Test-Path $targetPath)) { New-Item -Path $targetPath -ItemType Directory -ErrorAction SilentlyContinue | Out-Null } @@ -90,11 +91,13 @@ function Install-NuGetDependencies { } if (Test-Path $sourcePath) { Get-ChildItem $sourcePath -Filter '*.dll' | Copy-Item -Destination $targetPath -Force + $destFound = $true + break } - else { - Write-BuildError "$($pkg.Name) was not downloaded successfully from NuGet!" -ErrorAction Stop - exit 1 - } + } + if (!$destFound) { + Write-BuildError "$($pkg.Name) was not downloaded successfully from NuGet!" -ErrorAction Stop + exit 1 } } } diff --git a/ci/UpdateNuGetDependenciesJson.ps1 b/ci/UpdateNuGetDependenciesJson.ps1 index 38eb0e14..568d68d3 100644 --- a/ci/UpdateNuGetDependenciesJson.ps1 +++ b/ci/UpdateNuGetDependenciesJson.ps1 @@ -1,4 +1,4 @@ -if ($items = Get-ChildItem (Resolve-Path $PSScriptRoot\..\BuildOutput\PSGSuite\*\lib\net45 -ErrorAction SilentlyContinue).Path -Filter '*.dll' | Where-Object {$_.BaseName -ne 'Google.Apis.Auth.PlatformServices'}) { +if ($items = Get-ChildItem (Resolve-Path $PSScriptRoot\..\BuildOutput\PSGSuite\*\lib -ErrorAction SilentlyContinue).Path -Filter '*.dll' | Where-Object {$_.BaseName -ne 'Google.Apis.Auth.PlatformServices'}) { $items | #Where-Object | Sort-Object BaseName | From 516bca12377020884eda7ebc9fcfaab432fc5767 Mon Sep 17 00:00:00 2001 From: Nate Ferrell Date: Wed, 13 Nov 2024 17:56:52 -0600 Subject: [PATCH 27/27] chore: updated minimum PS version to 6.0 due to increased requirements from Google .NET SDKs --- psake.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psake.ps1 b/psake.ps1 index ae531bf7..ebd89a80 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -358,7 +358,7 @@ $pesterScriptBlock = { } catch { Write-BuildLog "[$($module.Name)] Installing missing module" - Install-Module @module -Repository PSGallery -Force + Install-Module @module -Repository PSGallery -Force -SkipPublisherCheck Import-Module @module } }