diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e51586..626e222 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,15 +25,24 @@ jobs: env: PFX_PWORD: ${{ secrets.PFX_PWORD }} PFX_CONTENT: ${{ secrets.BASE64_PFX_CONTENT }} + ROOT_CONTENT: ${{ secrets.BASE64_ROOT_CONTENT }} run: | cd ./InstanceExport/PowerShell; + + $rootPath = Join-Path -Path ./ -ChildPath "root.cer"; + $encodedBytes = [System.Convert]::FromBase64String($env:ROOT_CONTENT); + Set-Content $rootPath -Value $encodedBytes -AsByteStream; + Import-Certificate -FilePath ./root.cer -CertStoreLocation Cert:\LocalMachine\Root + $PWord = $env:PFX_PWORD; $Password = ConvertTo-SecureString -String $PWord -AsPlainText -Force; $pfxPath = Join-Path -Path ./ -ChildPath "cert.pfx"; $encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); Set-Content $pfxPath -Value $encodedBytes -AsByteStream; $cert = Import-PfxCertificate -FilePath ./cert.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $Password - Set-AuthenticodeSignature InstanceExport.ps1 $cert + + $sig = Set-AuthenticodeSignature InstanceExport.ps1 $cert -ErrorAction Stop + if ($sig.Status -ne 'Valid') { throw $sig.StatusMessage } shell: pwsh - name: Create Release if: startsWith(github.ref, 'refs/tags/') diff --git a/InstanceExport/PowerShell/README.md b/InstanceExport/PowerShell/README.md index da63a61..58ada57 100644 --- a/InstanceExport/PowerShell/README.md +++ b/InstanceExport/PowerShell/README.md @@ -4,7 +4,7 @@ At DevResults we value the concept that your data belongs to _you_, and you have In order to use it, you should: -1. Download the [InstanceExport.ps1](https://raw.githubusercontent.com/DevResults/DevResultsTools/main/InstanceExport/PowerShell/InstanceExport.ps1) PowerShell script available in this repo to your machine. One way to do this is to right click the link to the file name in the previous sentence and choose "Save link as..." to produce a save dialog box. +1. Download the [InstanceExport.ps1](https://github.com/DevResults/DevResultsTools/releases/download/1.0.2/InstanceExport.ps1) PowerShell script. 2. Reach out to us at help@devresults.com to request an Instance Export Manifest.