Execution Policy is not a security measure. It's present to prevent user from accidentally executing scripts. PowerShell Execution Policy is by default set to Restriced. It means that user can execute single commands but not to run any PS script (.ps1 files).
Most of the filtering cmdlets have useful aliases. All aliases can be listed using Get-Alias cmdlet. Most common ones:
3. Special variables
4. Calculated properties
Using @{} syntax we can specify calculated properties in one-liners. Inside the @{} we can specify many parameters (semicolon-separated). The most important ones are:
name (n) - name of the created property
expression (e) - script used to calculate the new property
5. Loops
6. String interpolation
TBD
7. Cmdlet parameters
Parameters like all names in Powershell are case-insensitive. Powershell allows abbreviated parameter names until the parameter is no longer unambiguous. In shell use it's helpful but it's not recommended practice in scripts since a later version of the cmdlet may no longer have the abbreviation be unambiguous.
To see exactly which parameters can be passed by pipeline or positionaly type Get-Help <command> -Full. There is a standarized list of all parameters with helpful attributes.
8. Utils
9. Invoke-Expression (iex)
TBD
10. Help
11. Active Directory
11.1. Built-in cmdlets
Many built-in PowerShell cmdlets can work on Distiguished Names of objects. To use them in the Active Directory context add AD:\ before the actual DN string. Example usage:
11.2. Interesting user properties
11.3. AD module convention
Server: AD commands can be executed against different domains or servers - select them using -server <domain> parameter:
Filter: AD objects can be filtered before the response is generated (it's faster than filtering objects after the response is received already). Use -Filter '<query>' to filter objects (or * to fetch them all). Syntax inside the '<query>' is basically the same as for the Where-Object command: PropertyName -operator "value".
IMPORTANT: A filter query needs to be written as a string! Best option is to use a single quote sign '.
Properties: AD objects usually have a large amount of properties. By default only small amount of them is actually returned from the DC. Use -Properties <prop1>,<prop2> to specify additional properties to fetch or * to select all of them.
11.4. AD module
11.5. PowerView module
PowerView script propably will be detected by AMSI. An AMSI bypass method needs to be applied.