Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
338717f
commit 42e945a
Showing
11 changed files
with
468 additions
and
92 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
# Version 1.0.24.17 (2017-03-05) | ||
## Functions | ||
### All | ||
* Added HelpUri and .LINK's to Comment based Help | ||
|
||
### OAuth functions | ||
* Standardized on "Oauth" in the function and file names (was a mix of "OAuth" and "Oath") | ||
|
||
### Get-AADGroupMember | ||
* Made function singular instead of plural (was Get-AADGroupMembers) | ||
* Added Get-AADGroupMembers alias | ||
* Fixed all the millions of problems this rename caused | ||
|
||
## Build Tools | ||
### psake.ps1 | ||
* Restructured psake.ps1 | ||
- Init > UnitTests > Build > Test > BuildDocs > Deploy > Post Deploy | ||
* Added AST based Function and Alias module manifest population | ||
* Added NestedModule Population | ||
* Added Release notes and change log auto processing and documentation | ||
* PostDeploy is now local build friendly | ||
|
||
## Tests | ||
### PSScriptAnalyzer.tests.Ps1 | ||
* Moved out of Project.Tests.ps1 | ||
* Re-wroded the tests so they display better in AppVeyor test logs | ||
* Removed .psd1 from the tests because it dose not appear to support suppression and certain test will falsely fail due to the text in RealseNotes | ||
|
||
### Project.Tests.ps1 | ||
* Moved the PSScriptAnalyzer tests to PSScriptAnalyzer.tests.Ps1 | ||
* Added Unit tag to "General project validation" so it test before and after build | ||
|
||
### New-GraphApplication.Unit.Tests.ps1 | ||
* Added Unit test for New-GraphApplication | ||
|
||
### New-GraphOauthAccessToken.Unit.Tests.ps1 | ||
* Added Unit test for New-GraphOauthAccessToken | ||
|
||
## Project | ||
### RELEASE.md | ||
* Added this to server as the current release notes | ||
* Integrates automatically with ChangeLog.md through build pipeline | ||
* Gets copied to ```docs/``` | ||
|
||
### ChangeLog.md | ||
* Added to ```docs/``` | ||
* Automatically managed by build process |
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,61 @@ | ||
<# | ||
.NOTES | ||
=========================================================================== | ||
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 | ||
Created on: 2/27/2017 4:42 AM | ||
Created by: Mark Kraus | ||
Organization: | ||
Filename: | ||
=========================================================================== | ||
.DESCRIPTION | ||
Unit Tests for New-GraphApplication | ||
#> | ||
|
||
$projectRoot = Resolve-Path "$PSScriptRoot\.." | ||
$moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") | ||
$moduleName = Split-Path $moduleRoot -Leaf | ||
Import-Module (Join-Path $moduleRoot "$moduleName.psd1") -force | ||
|
||
$Command = 'New-GraphApplication' | ||
|
||
$TypeName = 'MSGraphAPI.Application' | ||
$ClientID = '12345' | ||
$ClientSecret = '54321' | ||
$SecClientSecret = $ClientSecret | ConvertTo-SecureString -AsPlainText -Force | ||
$ClientCredential = [system.Management.Automation.PSCredential]::new($ClientID, $SecClientSecret) | ||
|
||
$Params = @{ | ||
Name = 'Unit Test Application' | ||
Description = 'This is a test of the emergency broadcast system' | ||
ClientCredential = $ClientCredential | ||
GUID = 'e2ad918e-dc87-4c23-803c-e67e43e0f217' | ||
RedirectUri = 'https://localhost' | ||
Tenant = 'adatum.onmicrosoft.com' | ||
} | ||
$RequiredParams = @( | ||
'Tenant' | ||
'Name' | ||
'ClientCredential' | ||
'RedirectUri' | ||
) | ||
Describe $Command -Tags Unit { | ||
It 'Does not have errors when passed required parameters' { | ||
$LocalParams = $Params.psobject.Copy() | ||
{ & $Command @LocalParams -ErrorAction Stop } | Should not throw | ||
} | ||
Foreach ($RequiredParam in $RequiredParams) { | ||
It "Requires the $RequiredParam parameter" { | ||
((Get-Command $Command).Parameters[$RequiredParam].Attributes | | ||
Where-Object { $_ -is [parameter] }).Mandatory | | ||
Should be $true | ||
} | ||
} | ||
It "Emits a $TypeName Object" { | ||
(Get-Command $Command).OutputType.Name.where({ $_ -eq $TypeName }) | Should be $TypeName | ||
} | ||
It "Creates a $TypeName Object" { | ||
$LocalParams = $Params.psobject.Copy() | ||
$Object = & $Command @LocalParams -ErrorAction SilentlyContinue | Select-Object -First 1 | ||
$Object.psobject.typenames.where({ $_ -eq $TypeName }) | Should be $TypeName | ||
} | ||
} |
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,83 @@ | ||
<# | ||
.NOTES | ||
=========================================================================== | ||
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 | ||
Created on: 2/27/2017 4:42 AM | ||
Created by: Mark Kraus | ||
Organization: | ||
Filename: | ||
=========================================================================== | ||
.DESCRIPTION | ||
Unit Tests for New-GraphOauthAccessToken | ||
#> | ||
|
||
$projectRoot = Resolve-Path "$PSScriptRoot\.." | ||
$moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") | ||
$moduleName = Split-Path $moduleRoot -Leaf | ||
Import-Module (Join-Path $moduleRoot "$moduleName.psd1") -force | ||
|
||
$Command = 'New-GraphOauthAccessToken' | ||
|
||
$TypeName = 'MSGraphAPI.Oauth.AccessToken' | ||
$ClientID = '12345' | ||
$ClientSecret = '54321' | ||
$SecClientSecret = $ClientSecret | ConvertTo-SecureString -AsPlainText -Force | ||
$ClientCredential = [system.Management.Automation.PSCredential]::new($ClientID, $SecClientSecret) | ||
$Params = @{ | ||
Name = 'Unit Test Application' | ||
Description = 'This is a test of the emergency broadcast system' | ||
ClientCredential = $ClientCredential | ||
GUID = 'e2ad918e-dc87-4c23-803c-e67e43e0f217' | ||
RedirectUri = 'https://localhost' | ||
Tenant = 'adatum.onmicrosoft.com' | ||
} | ||
$App = New-GraphApplication @Params | ||
|
||
$AToken = '67890' | ||
$SecAtoken = $Atoken | ConvertTo-SecureString -AsPlainText -Force | ||
$AccessTokenCredential = [system.Management.Automation.PSCredential]::new('access_token', $SecAtoken) | ||
$Rtoken = '09876' | ||
$SecRtoken = $Rtoken | ConvertTo-SecureString -AsPlainText -Force | ||
$RefreshTokenCredential = [system.Management.Automation.PSCredential]::new('refresh_token', $SecRtoken) | ||
|
||
$Params = @{ | ||
'Application' = $App | ||
'AccessTokenCredential' = $AccessTokenCredential | ||
'RefreshTokenCredential' = $RefreshTokenCredential | ||
'RequestedDate' = Get-Date | ||
'Response' = [pscustomobject]@{TestResponse = 'Test'} | ||
'ResponseHeaders' = [pscustomobject]@{ TestHeaders = 'Test' } | ||
'LastRequestDate' = get-date | ||
'GUID' = '1c6e3c87-8f77-435c-911d-3e97588918d0' | ||
'Session' = [Microsoft.PowerShell.Commands.WebRequestSession]::new() | ||
} | ||
$RequiredParams = @( | ||
'Application' | ||
'AccessTokenCredential' | ||
'RefreshTokenCredential' | ||
'RequestedDate' | ||
'Response' | ||
'ResponseHeaders' | ||
'LastRequestDate' | ||
) | ||
Describe $Command -Tags Unit { | ||
It 'Does not have errors when passed required parameters' { | ||
$LocalParams = $Params.psobject.Copy() | ||
{ & $Command @LocalParams -ErrorAction Stop } | Should not throw | ||
} | ||
Foreach ($RequiredParam in $RequiredParams) { | ||
It "Requires the $RequiredParam parameter" { | ||
((Get-Command $Command).Parameters[$RequiredParam].Attributes | | ||
Where-Object { $_ -is [parameter] }).Mandatory | | ||
Should be $true | ||
} | ||
} | ||
It "Emits a $TypeName Object" { | ||
(Get-Command $Command).OutputType.Name.where({ $_ -eq $TypeName }) | Should be $TypeName | ||
} | ||
It "Creates a $TypeName Object" { | ||
$LocalParams = $Params.psobject.Copy() | ||
$Object = & $Command @LocalParams -ErrorAction SilentlyContinue | Select-Object -First 1 | ||
$Object.psobject.typenames.where({ $_ -eq $TypeName }) | Should be $TypeName | ||
} | ||
} |
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,34 @@ | ||
<# | ||
.NOTES | ||
=========================================================================== | ||
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135 | ||
Created on: 2/28/2017 11:49 AM | ||
Editied on: 3/4/2017 | ||
Created by: Mark Kraus | ||
Organization: | ||
Filename: PSScriptAnalyzer.tests.Ps1 | ||
=========================================================================== | ||
.DESCRIPTION | ||
Runs PSScriptAnalyzer tests for every rule against every file in the module | ||
#> | ||
$projectRoot = Resolve-Path "$PSScriptRoot\.." | ||
$moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") | ||
$moduleName = Split-Path $moduleRoot -Leaf | ||
|
||
Describe "PSScriptAnalyzer Tests" -Tags Build { | ||
|
||
$Rules = Get-ScriptAnalyzerRule | ||
$scripts = Get-ChildItem $moduleRoot -Include *.ps1, *.psm1 -Recurse | Where-Object fullname -notmatch 'classes' | ||
|
||
foreach ($Script in $scripts) { | ||
$RelPath = $Script.FullName.Replace($moduleRoot, '') -replace '^\\', '' | ||
Context "$RelPath" { | ||
foreach ($rule in $rules) { | ||
It "Passes $rule" { | ||
|
||
(Invoke-ScriptAnalyzer -Path $script.FullName -IncludeRule $rule.RuleName).Count | Should Be 0 | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.