Skip to content

Commit

Permalink
add snippet: Exchange Online connection (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmsilvamolina authored and TylerLeonhardt committed Oct 23, 2018
1 parent 0388343 commit 777d4bf
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/community_snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ _To contribute, check out our [guide here](#contributing)._
| [DataTable](#datatable) | _Creates a DataTable_ |
| [DateTimeWriteVerbose](#datetimewriteverbose) | _Write-Verbose with the time and date pre-pended to your message by @ThmsRynr_ |
| [Error-Terminating](#error-terminating) | _Create a full terminating error by @omniomi_ |
| [Exchange Online Connection](exchange-online-connection) | _Create a connection to Exchange Online by @vmsilvamolina_ |
| [IfShouldProcess](#ifshouldprocess) | _Added If Should Process_ |
| [MaxColumnLengthinDataTable](#maxcolumnlengthindatatable) | _Gets the max length of string columns in datatables_ |
| [New Azure Resource Group](#new-azure-resource-group) | _Create an Azure Resource group by @vmsilvamolina_ |
Expand Down Expand Up @@ -177,6 +178,28 @@ Quickly add a fully defined error record and throw. by @omniomi
}
```

### Exchange Online Connection

Connect to Exchange Online, by @vmsilvamolina

#### Snippet

```json
"Exchange Online Connection": {
"prefix": "ex-ExchangeOnlineConnection",
"body": [
"#Set Execution Policy",
"Set-ExecutionPolicy RemoteSigned -Scope Process",
"#Define credential",
"\\$UserCredential = Get-Credential",
"# Create the session",
"\\$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential \\$UserCredential -Authentication Basic -AllowRedirection",
"Import-PSSession \\$Session -DisableNameChecking"
],
"description": "Connect to Exchange Online"
}
```

### IfShouldProcess

Add If Should Process with easy tab inputs
Expand Down

0 comments on commit 777d4bf

Please sign in to comment.