$null is a valid automatic variable in PowerShell. The problem in the shown command is not that PowerShell fails to recognize $null; the command syntax is incorrect.
Remove-CsApplicationAccessPolicy deletes an existing application access policy and the documented example is:
Remove-CsApplicationAccessPolicy -Identity "ASimplePolicy"
For TempPolicy1, use:
Remove-CsApplicationAccessPolicy -Identity "TempPolicy1"
Key points:
-
Grant-CsApplicationAccessPolicydoes not accept$nullas a parameter value for removing the policy globally. - To remove the policy itself, use
Remove-CsApplicationAccessPolicy. -
$nullin PowerShell represents a null value, and using an uninitialized variable also evaluates to$null. - If PowerShell says a term is not recognized, that specific term is being interpreted as a cmdlet or command name. In the shown input,
Fictional-CmdletName1is not a valid cmdlet name.
If commands are being pasted from a web page or document, run only the actual cmdlet line and remove any extra text before or after it.