-
-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor Sync-IncludeWithModule functionality #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -1,16 +1,13 @@ | |||
| Write-Information -Message ("Loading {0} ..." -f ($PSScriptRoot | Split-Path -Leaf)) -InformationAction continue | |||
| Write-Information -Message ("Loading {0} ..." -f ($PSCommandPath | Split-Path -LeafBase)) -InformationAction continue | |||
Check warning
Code scanning / PSScriptAnalyzer
Cmdlet 'Write-Information' may be used incorrectly. Please check that all mandatory parameters are supplied. Warning
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline,Position = 0)] | ||
| [string]$Path |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| $path = $path | Split-Path -Parent | ||
| continue | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| ) | ||
|
|
||
| # If folderName is not empty | ||
| if($FolderName -ne $null){ |
Check warning
Code scanning / PSScriptAnalyzer
$null should be on the left side of equality comparisons. Warning
| return $MODULE_NAME | ||
| } | ||
|
|
||
| function Get-ModuleFolder{ |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-ModuleFolder' does not have a help comment. Note
| $path = $path | Split-Path -Parent | ||
| continue | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| ) | ||
|
|
||
| # If folderName is not empty | ||
| if($FolderName -ne $null){ |
Check warning
Code scanning / PSScriptAnalyzer
$null should be on the left side of equality comparisons. Warning
| return $MODULE_NAME | ||
| } | ||
|
|
||
| function Get-ModuleFolder{ |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-ModuleFolder' does not have a help comment. Note
|
|
||
| $function = "Invoke-$($MODULE_NAME)GetDbRootPath" | ||
| if(-not (Test-Path -Path function:$function)){ | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| } | ||
| Rename-Item -path Function:Reset-MyModuleDatabaseStore -NewName "Reset-$($moduleName)DatabaseStore" | ||
| Export-ModuleMember -Function "Reset-$($moduleName)DatabaseStore" | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
Improve the structure and readability of the Sync-IncludeWithModule code by refining function definitions, enhancing error handling, and ensuring consistent formatting. This refactor aims to streamline the module's functionality and maintainability.