Skip to content

Commit 995bc1d

Browse files
authored
2 parents 2c7f116 + 852de1a commit 995bc1d

File tree

7 files changed

+51
-46
lines changed

7 files changed

+51
-46
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### Version: 0.1.35
2+
* Minor code style fixes
3+
* Edited CI in repo
4+
* Added Preview version autopublishing
5+
* Fixed error with comment-help. Get-Help \<command\> shows help description now
16
##### Version: 0.1.30
27

38
* Added getting token from certificate

Output/GraphApiRequests/0.1.34/GraphApiRequests.psd1 renamed to Output/GraphApiRequests/0.1.35/GraphApiRequests.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'GraphApiRequests.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.34'
15+
ModuleVersion = '0.1.35'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -27,7 +27,7 @@ Author = 'Aslan Imanalin'
2727
CompanyName = ''
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2021 Aslan Imanalin. All rights reserved.'
30+
Copyright = '(c) 2022 Aslan Imanalin. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'Module for GraphApi requests invocation.'

Source/GraphApiRequests.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'GraphApiRequests.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.1.34'
15+
ModuleVersion = '0.1.35'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -27,7 +27,7 @@ Author = 'Aslan Imanalin'
2727
CompanyName = ''
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2021 Aslan Imanalin. All rights reserved.'
30+
Copyright = '(c) 2022 Aslan Imanalin. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
3333
Description = 'Module for GraphApi requests invocation.'

Tests/TestResults.xml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2-
<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">
3-
<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" />
2+
<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">
3+
<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" />
44
<culture-info current-culture="en-US" current-uiculture="en-US" />
5-
<test-suite type="TestFixture" name="Pester" executed="True" result="Success" success="True" time="2.1664" asserts="0" description="Pester">
5+
<test-suite type="TestFixture" name="Pester" executed="True" result="Success" success="True" time="2.5637" asserts="0" description="Pester">
66
<results>
7-
<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">
7+
<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">
88
<results>
9-
<test-suite type="TestFixture" name="Get-GraphCertToken" executed="True" result="Success" success="True" time="0.1754" asserts="0" description="Get-GraphCertToken">
9+
<test-suite type="TestFixture" name="Get-GraphCertToken" executed="True" result="Success" success="True" time="0.1957" asserts="0" description="Get-GraphCertToken">
1010
<results>
11-
<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" />
11+
<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" />
1212
</results>
1313
</test-suite>
1414
</results>
1515
</test-suite>
16-
<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">
16+
<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">
1717
<results>
18-
<test-suite type="TestFixture" name="Get-GraphDeviceAuthCode" executed="True" result="Success" success="True" time="0.2338" asserts="0" description="Get-GraphDeviceAuthCode">
18+
<test-suite type="TestFixture" name="Get-GraphDeviceAuthCode" executed="True" result="Success" success="True" time="0.252" asserts="0" description="Get-GraphDeviceAuthCode">
1919
<results>
20-
<test-case description="Returns predefined object" name="Get-GraphDeviceAuthCode.Returns predefined object" time="0.2277" asserts="0" success="True" result="Success" executed="True" />
20+
<test-case description="Returns predefined object" name="Get-GraphDeviceAuthCode.Returns predefined object" time="0.2462" asserts="0" success="True" result="Success" executed="True" />
2121
</results>
2222
</test-suite>
2323
</results>
2424
</test-suite>
25-
<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">
25+
<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">
2626
<results>
27-
<test-suite type="TestFixture" name="Get-GraphDeviceAuthToken" executed="True" result="Success" success="True" time="0.0954" asserts="0" description="Get-GraphDeviceAuthToken">
27+
<test-suite type="TestFixture" name="Get-GraphDeviceAuthToken" executed="True" result="Success" success="True" time="0.0871" asserts="0" description="Get-GraphDeviceAuthToken">
2828
<results>
29-
<test-case description="It returns token" name="Get-GraphDeviceAuthToken.It returns token" time="0.0542" asserts="0" success="True" result="Success" executed="True" />
29+
<test-case description="It returns token" name="Get-GraphDeviceAuthToken.It returns token" time="0.0491" asserts="0" success="True" result="Success" executed="True" />
3030
</results>
3131
</test-suite>
3232
</results>
3333
</test-suite>
34-
<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">
34+
<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">
3535
<results>
36-
<test-suite type="TestFixture" name="Get-GraphToken" executed="True" result="Success" success="True" time="0.0478" asserts="0" description="Get-GraphToken">
36+
<test-suite type="TestFixture" name="Get-GraphToken" executed="True" result="Success" success="True" time="0.0286" asserts="0" description="Get-GraphToken">
3737
<results>
38-
<test-case description="Returns token object" name="Get-GraphToken.Returns token object" time="0.0117" asserts="0" success="True" result="Success" executed="True" />
39-
<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" />
38+
<test-case description="Returns token object" name="Get-GraphToken.Returns token object" time="0.0104" asserts="0" success="True" result="Success" executed="True" />
39+
<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" />
4040
</results>
4141
</test-suite>
4242
</results>
4343
</test-suite>
44-
<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">
44+
<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">
4545
<results>
46-
<test-suite type="TestFixture" name="Invoke-GraphApiRequest" executed="True" result="Success" success="True" time="0.2251" asserts="0" description="Invoke-GraphApiRequest">
46+
<test-suite type="TestFixture" name="Invoke-GraphApiRequest" executed="True" result="Success" success="True" time="0.4525" asserts="0" description="Invoke-GraphApiRequest">
4747
<results>
48-
<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">
48+
<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">
4949
<results>
50-
<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" />
51-
<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" />
50+
<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" />
51+
<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" />
5252
</results>
5353
</test-suite>
54-
<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">
54+
<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">
5555
<results>
56-
<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" />
57-
<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" />
58-
<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" />
59-
<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" />
56+
<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" />
57+
<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" />
58+
<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" />
59+
<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" />
6060
</results>
6161
</test-suite>
6262
</results>
6363
</test-suite>
6464
</results>
6565
</test-suite>
66-
<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">
66+
<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">
6767
<results>
68-
<test-suite type="TestFixture" name="New-GraphCertificate" executed="True" result="Success" success="True" time="0.3783" asserts="0" description="New-GraphCertificate">
68+
<test-suite type="TestFixture" name="New-GraphCertificate" executed="True" result="Success" success="True" time="0.5287" asserts="0" description="New-GraphCertificate">
6969
<results>
70-
<test-case description="Creates fake certificate" name="New-GraphCertificate.Creates fake certificate" time="0.0825" asserts="0" success="True" result="Success" executed="True" />
71-
<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" />
72-
<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" />
70+
<test-case description="Creates fake certificate" name="New-GraphCertificate.Creates fake certificate" time="0.1091" asserts="0" success="True" result="Success" executed="True" />
71+
<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" />
72+
<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" />
7373
</results>
7474
</test-suite>
7575
</results>

build.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ task DebugBuild -if ($Configuration -eq "debug") {
8787
}
8888

8989
Write-Verbose -Message "Updating Module Manifest with Public Functions"
90-
$publicFunctions = Get-ChildItem -Path ".\Source\Public\*.ps1"
91-
$privateFunctions = Get-ChildItem -Path ".\Source\Private\*.ps1"
90+
$PublicFunctions = Get-ChildItem -Path ".\Source\Public\*.ps1"
91+
$PrivateFunctions = Get-ChildItem -Path ".\Source\Private\*.ps1"
9292
try {
9393
Write-Verbose -Message "Appending Public functions to the psm file"
94-
$functionsToExport = New-Object -TypeName System.Collections.ArrayList
95-
foreach($function in $publicFunctions.Name){
96-
write-Verbose -Message "Exporting function: $(($function.split('.')[0]).ToString())"
97-
$functionsToExport.Add(($function.split('.')[0]).ToString())
94+
$FunctionsToExport = New-Object -TypeName System.Collections.ArrayList
95+
foreach($Function in $PublicFunctions.Name){
96+
write-Verbose -Message "Exporting function: $(($Function.split('.')[0]).ToString())"
97+
$FunctionsToExport.Add(($Function.split('.')[0]).ToString())
9898
}
9999
Update-ModuleManifest -Path ".\Output\temp\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $functionsToExport
100100
}
@@ -105,17 +105,17 @@ task DebugBuild -if ($Configuration -eq "debug") {
105105
Write-Verbose -Message "Building the .psm1 file"
106106
Write-Verbose -Message "Appending Public Functions"
107107
Add-Content -Path $ModuleFile -Value "### --- PUBLIC FUNCTIONS --- ###"
108-
foreach($function in $publicFunctions.Name){
108+
foreach($Function in $PublicFunctions.Name){
109109
try {
110-
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
111-
$content = Get-Content -Path ".\Source\Public\$($function)"
112-
Add-Content -Path $ModuleFile -Value "#Region - $function"
110+
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
111+
$Content = Get-Content -Path ".\Source\Public\$($Function)"
112+
Add-Content -Path $ModuleFile -Value "#Region - $Function"
113113
Add-Content -Path $ModuleFile -Value $content
114114
if($ExportAlias.IsPresent){
115115
$AliasSwitch = $false
116116
$Sel = Select-String -Path ".\Source\Public\$($function)" -Pattern "CmdletBinding" -Context 0,1
117117
$mylist = $Sel.ToString().Split([Environment]::NewLine)
118-
foreach($s in $mylist){
118+
foreach($s in $Mylist){
119119
if($s -match "Alias"){
120120
$alias = (($s.split(":")[2]).split("(")[1]).split(")")[0]
121121
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($function)"

0 commit comments

Comments
 (0)