-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/UniverseCitiz3n/Intune-Ap…
- Loading branch information
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Publish PowerShell Module | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-to-gallery: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and publish | ||
env: | ||
NUGET_KEY: ${{ secrets.NUGET_KEY }} | ||
shell: pwsh | ||
run: | | ||
.\build\build.ps1 | ||
Publish-Module -Path .\Intune-App-Sandbox -NuGetApiKey $env:NUGET_KEY -Verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test PowerShell on Windows | ||
on: push | ||
|
||
jobs: | ||
tests: | ||
name: Pester test and ScriptAnalyzer | ||
runs-on: windows-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- name: Perform a Pester test from the Tests.ps1 file | ||
shell: pwsh | ||
run: | | ||
Invoke-Pester .\tests\Unit.Tests.ps1 -Passthru | ||
- name: Install PSScriptAnalyzer module | ||
if: success() | ||
shell: pwsh | ||
run: | | ||
Set-PSRepository PSGallery -InstallationPolicy Trusted | ||
Install-Module PSScriptAnalyzer -ErrorAction Stop | ||
- name: Lint with PSScriptAnalyzer | ||
if: success() | ||
shell: pwsh | ||
run: | | ||
Invoke-ScriptAnalyzer -Path .\Intune-App-Sandbox\Public\*.ps1 -Recurse -Outvariable issues -ExcludeRule PSAvoidUsingWriteHost,PSUseShouldProcessForStateChangingFunctions | ||
$errors = $issues.Where({$_.Severity -eq 'Error'}) | ||
$warnings = $issues.Where({$_.Severity -eq 'Warning'}) | ||
if ($errors) { | ||
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop | ||
} else { | ||
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$Global:ErrorActionPreference = 'Stop' | ||
$Global:VerbosePreference = 'SilentlyContinue' | ||
|
||
### Prepare NuGet / PSGallery | ||
if (!(Get-PackageProvider | Where-Object { $_.Name -eq 'NuGet' })) { | ||
"Installing NuGet" | ||
Install-PackageProvider -Name NuGet -force | Out-Null | ||
} | ||
"Preparing PSGallery repository" | ||
Import-PackageProvider -Name NuGet -force | Out-Null | ||
if ((Get-PSRepository -Name PSGallery).InstallationPolicy -ne 'Trusted') { | ||
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Describe "CHECK CONFIGURATION FILES ARE PRESENT" { | ||
It "Check configuration files are present" { | ||
(Get-ChildItem .\Intune-App-Sandbox\Configuration\* -Recurse | Measure-Object).Count | Should -Be 8 | ||
} | ||
$Files = ('intunewin-Box-icon.ico', 'IntuneWinAppUtil.exe', 'IntuneWinAppUtilDecoder.exe', 'Invoke-IntunewinUtil.ps1', 'Invoke-Test.ps1', 'New-ToastNotification.ps1', 'sandbox.ico', 'toast.xml') | ||
foreach ($item in $Files) { | ||
It "Checking for $item" { | ||
Test-Path .\Intune-App-Sandbox\Configuration\$item | Should -Be $true | ||
} | ||
} | ||
} |