Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
aslan-im authored Aug 29, 2022
2 parents 2c7f116 + 852de1a commit 995bc1d
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 46 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### Version: 0.1.35
* Minor code style fixes
* Edited CI in repo
* Added Preview version autopublishing
* Fixed error with comment-help. Get-Help \<command\> shows help description now
##### Version: 0.1.30

* Added getting token from certificate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'GraphApiRequests.psm1'

# Version number of this module.
ModuleVersion = '0.1.34'
ModuleVersion = '0.1.35'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -27,7 +27,7 @@ Author = 'Aslan Imanalin'
CompanyName = ''

# Copyright statement for this module
Copyright = '(c) 2021 Aslan Imanalin. All rights reserved.'
Copyright = '(c) 2022 Aslan Imanalin. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Module for GraphApi requests invocation.'
Expand Down
4 changes: 2 additions & 2 deletions Source/GraphApiRequests.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'GraphApiRequests.psm1'

# Version number of this module.
ModuleVersion = '0.1.34'
ModuleVersion = '0.1.35'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -27,7 +27,7 @@ Author = 'Aslan Imanalin'
CompanyName = ''

# Copyright statement for this module
Copyright = '(c) 2021 Aslan Imanalin. All rights reserved.'
Copyright = '(c) 2022 Aslan Imanalin. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Module for GraphApi requests invocation.'
Expand Down
62 changes: 31 additions & 31 deletions Tests/TestResults.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="14" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2022-08-29" time="07:16:31">
<environment os-version="10.0.20348" platform="Microsoft Windows Server 2022 Datacenter|C:\Windows|\Device\Harddisk0\Partition2" machine-name="fv-az319-907" cwd="D:\a\GraphApiRequests\GraphApiRequests" user="runneradmin" clr-version="Unknown" user-domain="fv-az319-907" nunit-version="2.5.8.0" />
<test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="14" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2022-08-29" time="17:13:58">
<environment cwd="D:\a\GraphApiRequests\GraphApiRequests" nunit-version="2.5.8.0" user="runneradmin" machine-name="fv-az140-300" platform="Microsoft Windows Server 2022 Datacenter|C:\Windows|\Device\Harddisk0\Partition2" user-domain="fv-az140-300" os-version="10.0.20348" clr-version="Unknown" />
<culture-info current-culture="en-US" current-uiculture="en-US" />
<test-suite type="TestFixture" name="Pester" executed="True" result="Success" success="True" time="2.1664" asserts="0" description="Pester">
<test-suite type="TestFixture" name="Pester" executed="True" result="Success" success="True" time="2.5637" asserts="0" description="Pester">
<results>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphCertToken.Tests.ps1" executed="True" result="Success" success="True" time="0.7022" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphCertToken.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphCertToken.Tests.ps1" executed="True" result="Success" success="True" time="0.7031" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphCertToken.Tests.ps1">
<results>
<test-suite type="TestFixture" name="Get-GraphCertToken" executed="True" result="Success" success="True" time="0.1754" asserts="0" description="Get-GraphCertToken">
<test-suite type="TestFixture" name="Get-GraphCertToken" executed="True" result="Success" success="True" time="0.1957" asserts="0" description="Get-GraphCertToken">
<results>
<test-case description="Returns True. All mandatory params are mandatory" name="Get-GraphCertToken.Returns True. All mandatory params are mandatory" time="0.1255" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Returns True. All mandatory params are mandatory" name="Get-GraphCertToken.Returns True. All mandatory params are mandatory" time="0.1221" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
</test-suite>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthCode.Tests.ps1" executed="True" result="Success" success="True" time="0.3316" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthCode.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthCode.Tests.ps1" executed="True" result="Success" success="True" time="0.4176" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthCode.Tests.ps1">
<results>
<test-suite type="TestFixture" name="Get-GraphDeviceAuthCode" executed="True" result="Success" success="True" time="0.2338" asserts="0" description="Get-GraphDeviceAuthCode">
<test-suite type="TestFixture" name="Get-GraphDeviceAuthCode" executed="True" result="Success" success="True" time="0.252" asserts="0" description="Get-GraphDeviceAuthCode">
<results>
<test-case description="Returns predefined object" name="Get-GraphDeviceAuthCode.Returns predefined object" time="0.2277" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Returns predefined object" name="Get-GraphDeviceAuthCode.Returns predefined object" time="0.2462" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
</test-suite>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthToken.Tests.ps1" executed="True" result="Success" success="True" time="0.1417" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthToken.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthToken.Tests.ps1" executed="True" result="Success" success="True" time="0.1297" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphDeviceAuthToken.Tests.ps1">
<results>
<test-suite type="TestFixture" name="Get-GraphDeviceAuthToken" executed="True" result="Success" success="True" time="0.0954" asserts="0" description="Get-GraphDeviceAuthToken">
<test-suite type="TestFixture" name="Get-GraphDeviceAuthToken" executed="True" result="Success" success="True" time="0.0871" asserts="0" description="Get-GraphDeviceAuthToken">
<results>
<test-case description="It returns token" name="Get-GraphDeviceAuthToken.It returns token" time="0.0542" asserts="0" success="True" result="Success" executed="True" />
<test-case description="It returns token" name="Get-GraphDeviceAuthToken.It returns token" time="0.0491" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
</test-suite>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphToken.Tests.ps1" executed="True" result="Success" success="True" time="0.2068" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphToken.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphToken.Tests.ps1" executed="True" result="Success" success="True" time="0.1876" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Get-GraphToken.Tests.ps1">
<results>
<test-suite type="TestFixture" name="Get-GraphToken" executed="True" result="Success" success="True" time="0.0478" asserts="0" description="Get-GraphToken">
<test-suite type="TestFixture" name="Get-GraphToken" executed="True" result="Success" success="True" time="0.0286" asserts="0" description="Get-GraphToken">
<results>
<test-case description="Returns token object" name="Get-GraphToken.Returns token object" time="0.0117" asserts="0" success="True" result="Success" executed="True" />
<test-case description="All params should be True" name="Get-GraphToken.All params should be True" time="0.0255" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Returns token object" name="Get-GraphToken.Returns token object" time="0.0104" asserts="0" success="True" result="Success" executed="True" />
<test-case description="All params should be True" name="Get-GraphToken.All params should be True" time="0.008" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
</test-suite>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Invoke-GraphApiRequest.Tests.ps1" executed="True" result="Success" success="True" time="0.3557" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Invoke-GraphApiRequest.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\Invoke-GraphApiRequest.Tests.ps1" executed="True" result="Success" success="True" time="0.5418" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\Invoke-GraphApiRequest.Tests.ps1">
<results>
<test-suite type="TestFixture" name="Invoke-GraphApiRequest" executed="True" result="Success" success="True" time="0.2251" asserts="0" description="Invoke-GraphApiRequest">
<test-suite type="TestFixture" name="Invoke-GraphApiRequest" executed="True" result="Success" success="True" time="0.4525" asserts="0" description="Invoke-GraphApiRequest">
<results>
<test-suite type="TestFixture" name="Invoke-GraphApiRequest.Get function with Token" executed="True" result="Success" success="True" time="0.0285" asserts="0" description="Invoke-GraphApiRequest.Get function with Token">
<test-suite type="TestFixture" name="Invoke-GraphApiRequest.Get function with Token" executed="True" result="Success" success="True" time="0.0269" asserts="0" description="Invoke-GraphApiRequest.Get function with Token">
<results>
<test-case description="Returns predefined object " name="Invoke-GraphApiRequest.Get function with Token.Returns predefined object " time="0.018" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Requires mandatory param" name="Invoke-GraphApiRequest.Get function with Token.Requires mandatory param" time="0.0055" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Returns predefined object " name="Invoke-GraphApiRequest.Get function with Token.Returns predefined object " time="0.017" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Requires mandatory param" name="Invoke-GraphApiRequest.Get function with Token.Requires mandatory param" time="0.0052" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
<test-suite type="TestFixture" name="Invoke-GraphApiRequest.Get Function without Token" executed="True" result="Success" success="True" time="0.178" asserts="0" description="Invoke-GraphApiRequest.Get Function without Token">
<test-suite type="TestFixture" name="Invoke-GraphApiRequest.Get Function without Token" executed="True" result="Success" success="True" time="0.1561" asserts="0" description="Invoke-GraphApiRequest.Get Function without Token">
<results>
<test-case description="Returns predefined object" name="Invoke-GraphApiRequest.Get Function without Token.Returns predefined object" time="0.0161" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of TenantID" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of TenantID" time="0.0492" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of AppId" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of AppId" time="0.0097" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of AppSecret" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of AppSecret" time="0.0689" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Returns predefined object" name="Invoke-GraphApiRequest.Get Function without Token.Returns predefined object" time="0.0162" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of TenantID" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of TenantID" time="0.0926" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of AppId" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of AppId" time="0.008" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throw because of AppSecret" name="Invoke-GraphApiRequest.Get Function without Token.Throw because of AppSecret" time="0.0078" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\New-GraphCertificate.Tests.ps1" executed="True" result="Success" success="True" time="0.4284" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\New-GraphCertificate.Tests.ps1">
<test-suite type="TestFixture" name="D:\a\GraphApiRequests\GraphApiRequests\Tests\New-GraphCertificate.Tests.ps1" executed="True" result="Success" success="True" time="0.5838" asserts="0" description="D:\a\GraphApiRequests\GraphApiRequests\Tests\New-GraphCertificate.Tests.ps1">
<results>
<test-suite type="TestFixture" name="New-GraphCertificate" executed="True" result="Success" success="True" time="0.3783" asserts="0" description="New-GraphCertificate">
<test-suite type="TestFixture" name="New-GraphCertificate" executed="True" result="Success" success="True" time="0.5287" asserts="0" description="New-GraphCertificate">
<results>
<test-case description="Creates fake certificate" name="New-GraphCertificate.Creates fake certificate" time="0.0825" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throws because of ExpirationDate" name="New-GraphCertificate.Throws because of ExpirationDate" time="0.0194" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Tenant name is mandatory" name="New-GraphCertificate.Tenant name is mandatory" time="0.0217" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Creates fake certificate" name="New-GraphCertificate.Creates fake certificate" time="0.1091" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Throws because of ExpirationDate" name="New-GraphCertificate.Throws because of ExpirationDate" time="0.0237" asserts="0" success="True" result="Success" executed="True" />
<test-case description="Tenant name is mandatory" name="New-GraphCertificate.Tenant name is mandatory" time="0.0047" asserts="0" success="True" result="Success" executed="True" />
</results>
</test-suite>
</results>
Expand Down
22 changes: 11 additions & 11 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ task DebugBuild -if ($Configuration -eq "debug") {
}

Write-Verbose -Message "Updating Module Manifest with Public Functions"
$publicFunctions = Get-ChildItem -Path ".\Source\Public\*.ps1"
$privateFunctions = Get-ChildItem -Path ".\Source\Private\*.ps1"
$PublicFunctions = Get-ChildItem -Path ".\Source\Public\*.ps1"
$PrivateFunctions = Get-ChildItem -Path ".\Source\Private\*.ps1"
try {
Write-Verbose -Message "Appending Public functions to the psm file"
$functionsToExport = New-Object -TypeName System.Collections.ArrayList
foreach($function in $publicFunctions.Name){
write-Verbose -Message "Exporting function: $(($function.split('.')[0]).ToString())"
$functionsToExport.Add(($function.split('.')[0]).ToString())
$FunctionsToExport = New-Object -TypeName System.Collections.ArrayList
foreach($Function in $PublicFunctions.Name){
write-Verbose -Message "Exporting function: $(($Function.split('.')[0]).ToString())"
$FunctionsToExport.Add(($Function.split('.')[0]).ToString())
}
Update-ModuleManifest -Path ".\Output\temp\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $functionsToExport
}
Expand All @@ -105,17 +105,17 @@ task DebugBuild -if ($Configuration -eq "debug") {
Write-Verbose -Message "Building the .psm1 file"
Write-Verbose -Message "Appending Public Functions"
Add-Content -Path $ModuleFile -Value "### --- PUBLIC FUNCTIONS --- ###"
foreach($function in $publicFunctions.Name){
foreach($Function in $PublicFunctions.Name){
try {
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
$content = Get-Content -Path ".\Source\Public\$($function)"
Add-Content -Path $ModuleFile -Value "#Region - $function"
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
$Content = Get-Content -Path ".\Source\Public\$($Function)"
Add-Content -Path $ModuleFile -Value "#Region - $Function"
Add-Content -Path $ModuleFile -Value $content
if($ExportAlias.IsPresent){
$AliasSwitch = $false
$Sel = Select-String -Path ".\Source\Public\$($function)" -Pattern "CmdletBinding" -Context 0,1
$mylist = $Sel.ToString().Split([Environment]::NewLine)
foreach($s in $mylist){
foreach($s in $Mylist){
if($s -match "Alias"){
$alias = (($s.split(":")[2]).split("(")[1]).split(")")[0]
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($function)"
Expand Down

0 comments on commit 995bc1d

Please sign in to comment.