Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add snippet: Exchange Online connection #1567

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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