If a command exports users whose names
contain foreign characters into a CVS file, those foreign characters
will be replaced with a "?". To preserve those foreign
characters, use Export-Csv $outputfile -Encoding UTF8

However, this is only ever necessary in such cases as shown above.
Usually you get automatic line continuation when a command cannot
syntactically be complete at that point.
This includes starting a new pipeline element:

sometimes you can assign the $null variable.
Other times you must use the -clear operator.

null, check if string is null

if([string]::IsNullOrEmpty($mystring) {Write-Host"string is NULL or EMPTY"} else {Write-Host"string has a value"}

null, check if property is null when filtering

Normally, you can simply filter on
someProperty -ne $null.
But when trying to filter on some commands like Get-AdUser, problems because PowerShell doesn't recognize what the
$null variable is in that context.
So instead, filter on -notlike "*".

In the "Action" tab, for the "Start a program",
need to have "powershell" for the "Program/script"
and the file location for the "Add arguments (optional)".
If you're attempting to run some commands - like
New-Object
IO.FileSystemWatcher then you must precede the file name with
"-NoExit . " (including the dot).

in the "Actions" tab, in the "Start a program"
area, put in "powershell"

In the "Add arguments" area, put in "-ExecutionPolicy Bypass D:\path\YourPowerShellScript.ps1"

If you see, "This task requires that the user account
specified has Log on as batch job rights" the user must be able to do the following

Start -> Run

Type in secpol.msc /s

Select "Local Policies" in MSC snap in

Select "User Rights Assignment"

Right click on "Log on as batch job" and select Properties

Click "Add User or Group", and include the relevant user.

tenant, which one am I on?

Get-MsolAccountSku

The command above returns a list of SKUs, each of which includes an AccountSkuID
field. The first part of this each of the AccountSkuID field
on every row in this list of SKUs has the tenant name.
If you just want the tenant name all by itself, use this instead:

(Get-MsolAccountSku)[0].AccountSkuId.split(":")[0]

which looks at the AccountSkuID field of the first SKU in the array
and then uses the portion before the colon.

term 'xx' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included,
verify that the path is correct and try again. (Exchange)

for example:

get-mailbox -ResultSize Unlimited

returns:

get-mailbox : The term 'get-mailbox' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ get-mailbox -ResultSize Unlimited
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-mailbox:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException