-
Notifications
You must be signed in to change notification settings - Fork 102
Do And Do Not
-
Prefer dot notation over
Select -ExpandProperty
.- eg.
(Get-ChildItem).FullName
- eg.
-
When supressing output using null types, use chained assignment.
- eg.
$null = $result = Command-WhichProducedOutputWhenAssigned
- eg.
-
Avoid Write-Output, instead return useful objects closest to the value type of the target
-
If you need to initialize a value, use $null and avoid values such as a blank string
-
-
eg. Constructing a pscustomobject from a hash table, also useful for cheap object creation:
[pscustomobject]@{ ServerName = $servername IsEnabled = $true }
-
-
Avoid continuation marks (backticks) in code if at all possible.
-
Casing follows PowerShell community recommendations:
-
Lower:
- Language keyword (try, catch, foreach)
- Process block keyword (begin, process, end)
-
Pascal:
- Comment help keywords (.Example, .Synopsis)
- Package or modules
- Class
- Exception
- Global variables
-
Camel Case:
- Local variables ($localArgument)
-
There may be rare cases in which features do not work without required casing, in those cases ignore these recommendations.
-
-
The defacto naming convention for any command is ApprovedVerb-D365*
-
Open braces on the same line, Closing braces always on their own line.
Note: This entire page is deeply inspired by the work done over in the dbatool.io module. Pay them a visit and learn from the very same people as we did.
- Install as a non-Administrator
- Install as a Administrator
- Import d365fo.tools module
- List available commands from d365fo.tools module
- Get help content for a command
- Start, Stop and List services
- Import users into the D365FO environment
- Import external users into the D365FO environment
- Enable users in the D365FO environment
- Update users in the D365FO environment
- Provision D365FO environment to new Azure AD tenant
- Import a bacpac file into a Tier1 environment
- List modules / models
- Compile module
- Install AzCopy
- Install SqlPackage
- Install Nuget
- Speed up LCS download via AzCopy
- Download latest bacpac from LCS via AzCopy
- Register NuGet source
- Configure Azure Logic App
- Fix AzureStorageConfig
- Run a runnable class
- Update users in environment
- Work with Azure Storage Account
- Work with packages, resource label files, language and lables
- Working with the different D365 services