Tuesday, December 18, 2018

PowerShell 101 - Basics


How to get Help

https://docs.microsoft.com/en-us/powershell

Help
Get-Help
Help vs Get-Command
search command using Bing or google

Search using https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/?view=powershell-6

How to Edit

Tab Complete
History

What is Piping?

Select
More

example: Get-Process | More
example: Get-Process | Select * | More

example: Get-Command | Measure-Object

Variables?

variables
collections
array
Get-Member

example: $temp = Get-Process
example: $temp | Get-Member
example: $temp = Get-Process[0]


Note if help files are missing run update-help or go here to help online


How to get Help

Help
Get-Help
Help vs Get-Command
search

How to Edit

Tab Complete
History

What is Piping?

Select
More
Measure

Variables?

collections
array
get member

Editor

Command line vs ISE

Keyboard Shortcuts

https://msdn.microsoft.com/en-us/powershell/scripting/core-powershell/ise/keyboard-shortcuts-for-the-windows-powershell-ise
https://technet.microsoft.com/en-us/library/ff678293.aspx

Tuesday, December 4, 2018

SharePoint PowerShell 2013 Reference Guide

SharePoint PowerShell from 20331 and 20332

Managed Metadata

New-ADUser -SamAccountName SPSalesMMS -Name "SharePoint Sales MMS" -UserPrincipalName "SPSalesMMS@contoso.com" -AccountPassword (Read-host “enter password” -AsSecureString) -Path “OU=SharePoint,DC=Contoso,DC=com” -Enabled $true -PasswordNeverExpires $true -ChangePasswordAtLogon $false

New-SPManagedAccount

$AppPool = New-SPServiceApplicationPool -Name ContosoSalesMMSAppPool -Account SPSalesMMS@contoso.com

$MMS = New-SPMetadataServiceApplication -Name "Contoso Sales Managed Metadata" -ApplicationPool $AppPool -DatabaseName ContosoSalesMMS -HubUri http://sales.contoso.com

New-SPMetadataServiceApplicationProxy -Name "Contoso Sales Managed Metadata" -ServiceApplication $MMS –DefaultProxyGroup

State Service

$serviceApp = New-SPStateServiceApplication -Name "StateService-App"

New-SPStateServiceDatabase -Name "SS-Database" -ServiceApplication $serviceApp

New-SPStateServiceApplicationProxy -Name "StateService-App" -ServiceApplication $serviceApp -DefaultProxyGroup