Skip to content

Commit

Permalink
Bielawb/issue 4 (#28)
Browse files Browse the repository at this point in the history
* Adding very first version of tests/appveyor configuration

* Moving phases in AppVeyor to separate scripts to avoid to much PS code in yml

* Adding first global tests

* Adding first assertion + export tests + more clear test headers

* Attempt to upload test results

* Adding some help/ manifests tests that should fail

* Making sure when it fails, it fails

* Updates for help and markdown + more tests

* Adding 1st draft for AQS help

* More help, complete about topics

* Fixing some remaining issues with help examples

* Attempt to generate a zip from the module

* Version up
  • Loading branch information
bielawb authored Apr 24, 2018
1 parent fde04ea commit bdfc5d7
Show file tree
Hide file tree
Showing 26 changed files with 3,961 additions and 2,760 deletions.
2 changes: 1 addition & 1 deletion EWS/EWS.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'EWS.psm1'

# Version number of this module.
ModuleVersion = '1.1.4'
ModuleVersion = '1.1.5'

# ID used to uniquely identify this module
GUID = 'd1acb385-ff90-400f-ac66-04ba0da20ed4'
Expand Down
5,904 changes: 3,322 additions & 2,582 deletions EWS/en-US/EWS-help.xml

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions EWS/en-US/about_AQS.help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
TOPIC
about_aqs

ABOUT TOPIC NOTE:
The first header of the about topic should be the topic name.
The second header contains the lookup name used by the help system.

IE:
# Some Help Topic Name
## SomeHelpTopicFileName

This will be transformed into the text file
as `about_SomeHelpTopicFileName`.
Do not include file extensions.
The second header should have no spaces.

SHORT DESCRIPTION
{{ Short Description Placeholder }}

ABOUT TOPIC NOTE:
About topics can be no longer than 80 characters wide when rendered to text.
Any topics greater than 80 characters will be automatically wrapped.
The generated about topic will be encoded UTF-8.

LONG DESCRIPTION
{{ Long Description Placeholder }}

Optional Subtopics
{{ Optional Subtopic Placeholder }}

EXAMPLES
{{ Code or descriptive examples of how to leverage the functions described.
}}

NOTE
{{ Note Placeholder - Additional information that a user needs to know.}}

TROUBLESHOOTING NOTE
{{ Troubleshooting Placeholder - Warns users of bugs}}
{{ Explains behavior that is likely to change with fixes }}

SEE ALSO
{{ See also placeholder }}
{{ You can also list related articles, blogs, and video URLs. }}

KEYWORDS
{{List alternate names or titles for this topic that readers might use.}}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}

52 changes: 52 additions & 0 deletions EWS/en-US/about_EWS.help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
TOPIC
about_ews

ABOUT TOPIC NOTE:
The first header of the about topic should be the topic name.
The second header contains the lookup name used by the help system.

IE:
# Some Help Topic Name
## SomeHelpTopicFileName

This will be transformed into the text file
as `about_SomeHelpTopicFileName`.
Do not include file extensions.
The second header should have no spaces.

SHORT DESCRIPTION
{{ Short Description Placeholder }}

ABOUT TOPIC NOTE:
About topics can be no longer than 80 characters wide when rendered to text.
Any topics greater than 80 characters will be automatically wrapped.
The generated about topic will be encoded UTF-8.

LONG DESCRIPTION
{{ Long Description Placeholder }}

Optional Subtopics
{{ Optional Subtopic Placeholder }}

EXAMPLES
{{ Code or descriptive examples of how to leverage the functions described.
}}

NOTE
{{ Note Placeholder - Additional information that a user needs to know.}}

TROUBLESHOOTING NOTE
{{ Troubleshooting Placeholder - Warns users of bugs}}
{{ Explains behavior that is likely to change with fixes }}

SEE ALSO
{{ See also placeholder }}
{{ You can also list related articles, blogs, and video URLs. }}

KEYWORDS
{{List alternate names or titles for this topic that readers might use.}}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}
- {{ Keyword Placeholder }}

13 changes: 6 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
install:
- ps: |
.\build\Install.ps1
- ps: .\build\Install.ps1

build_script:
- ps: |
.\build\Build.ps1
- ps: .\build\Build.ps1

test_script:
- ps: |
.\build\Test.ps1
- ps: .\build\Test.ps1

on_success:
- ps: .\build\Publish.ps1
3 changes: 3 additions & 0 deletions build/Publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ProgressPreference = 'SilentlyContinue'
7z a EWS.zip .\EWS
Push-AppveyorArtifact EWS.zip
17 changes: 16 additions & 1 deletion build/Test.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Import-Module -Name Pester
Import-Module -Name .\EWS
Invoke-Pester -Script .\tests\ -EnableExit
Import-Module -Name .\tests\Assertions.psm1
$out = Invoke-Pester -Script .\tests\ -OutputFormat NUnitXml -OutputFile .\tests\results.xml -PassThru
try {
[System.Net.WebClient]::
new().
UploadFile(
"https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path .\tests\results.xml)
)
} catch {
throw "Failed to upload tests - $_"
}

if ($failed = $out.FailedCount) {
throw "Failed tests: $failed"
}
22 changes: 12 additions & 10 deletions docs/Clear-EWSFolder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
external help file: EWS-help.xml
online version:
Module Name: EWS
online version:
schema: 2.0.0
---

Expand All @@ -13,7 +14,7 @@ Clears content of a folder.

```
Clear-EWSFolder [[-DeleteMode] <DeleteMode>] [[-Service] <ExchangeService>] [-Folder] <Folder>
[-IncludeSubfolders] [-WhatIf] [-Confirm]
[-IncludeSubfolders] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -28,7 +29,7 @@ User can specify mode that will be used to delete items/folders:

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
### EXAMPLE 1
```
PS C:\> Get-EWSFolder Inbox\ToDelete | Clear-EWSFolder
```
Expand All @@ -37,7 +38,7 @@ Clears content of Inbox\ToDelete folder, leaving sub-folders intact.
Will prompt the user before performing the operation.
Uses MoveToDeletedItems mode to remove items (default).

### -------------------------- EXAMPLE 2 --------------------------
### EXAMPLE 2
```
PS C:\> Get-EWSFolder Inbox\ToDelete | Clear-EWSFolder -IncludeSubfolders -Confirm:$false -DeleteMode HardDelete
```
Expand Down Expand Up @@ -70,7 +71,7 @@ Will use MoveToDeletedItems mode when nothing is specified.
```yaml
Type: DeleteMode
Parameter Sets: (All)
Aliases:
Aliases:
Accepted values: HardDelete, SoftDelete, MoveToDeletedItems

Required: False
Expand All @@ -86,7 +87,7 @@ Folder object that should be moved (retrieved using Get-EWSFolder).
```yaml
Type: Folder
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 2
Expand All @@ -101,7 +102,7 @@ Flag to specify if sub-folders and items in them should be removed too.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -116,7 +117,7 @@ Service object that will be used to move folder.
```yaml
Type: ExchangeService
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 1
Expand All @@ -141,17 +142,18 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### Microsoft.Exchange.WebServices.Data.ExchangeService
Microsoft.Exchange.WebServices.Data.Folder
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS
25 changes: 14 additions & 11 deletions docs/Connect-EWSService.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
external help file: EWS-help.xml
online version:
Module Name: EWS
online version:
schema: 2.0.0
---

Expand All @@ -13,7 +14,7 @@ Connects to Exchange Web Service.

```
Connect-EWSService [-Mailbox] <String> [[-ServiceUrl] <String>] [[-Version] <ExchangeVersion>]
[[-Credential] <PSCredential>]
[[-Credential] <PSCredential>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -23,17 +24,19 @@ By default it will attempt to auto-discover service URL. User may decide to prov

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
### EXAMPLE 1
```
PS C:\> Connect-EWSService -Mailbox [email protected]
```

Connects to [email protected] mailbox.
Uses default credentials and auto-discovers service URL.

### -------------------------- EXAMPLE 2 --------------------------
### EXAMPLE 2
```
PS C:\> Connect-EWSService -Mailbox [email protected] -Credential [email protected]
```

Connects to [email protected] mailbox.
Prompts for [email protected] password.
Auto-discovers service URL.
Expand All @@ -46,7 +49,7 @@ Credentials used to authenticate to Exchange Web Service.
```yaml
Type: PSCredential
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 2
Expand All @@ -61,7 +64,7 @@ Mailbox that supports Exchange Web Services.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 0
Expand All @@ -76,7 +79,7 @@ Optional URL to service (when specified, auto-discovery is not used).
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 1
Expand All @@ -91,7 +94,7 @@ Version of Exchange Web Service.
```yaml
Type: ExchangeVersion
Parameter Sets: (All)
Aliases:
Aliases:
Accepted values: Exchange2007_SP1, Exchange2010, Exchange2010_SP1, Exchange2010_SP2, Exchange2013, Exchange2013_SP1

Required: False
Expand All @@ -101,17 +104,17 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### None
## OUTPUTS
### Microsoft.Exchange.WebServices.Data.ExchangeService
## NOTES
## RELATED LINKS
Loading

0 comments on commit bdfc5d7

Please sign in to comment.