Skip to content

Refactor Sync-IncludeWithModule functionality#6

Merged
rulasg merged 2 commits into
mainfrom
sync-include
Aug 8, 2025
Merged

Refactor Sync-IncludeWithModule functionality#6
rulasg merged 2 commits into
mainfrom
sync-include

Conversation

@rulasg

@rulasg rulasg commented Aug 8, 2025

Copy link
Copy Markdown
Owner

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.

Comment thread Test/Test.psm1
@@ -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

Cmdlet 'Write-Information' may be used incorrectly. Please check that all mandatory parameters are supplied.
[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

Command accepts pipeline input but has not defined a process block.
$path = $path | Split-Path -Parent
continue
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
)

# 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

$null should be on the left side of equality comparisons.
return $MODULE_NAME
}

function Get-ModuleFolder{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Get-ModuleFolder' does not have a help comment. Note

The cmdlet 'Get-ModuleFolder' does not have a help comment.
Comment thread helper/module.helper.ps1
$path = $path | Split-Path -Parent
continue
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
Comment thread helper/module.helper.ps1
)

# 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

$null should be on the left side of equality comparisons.
Comment thread helper/module.helper.ps1
return $MODULE_NAME
}

function Get-ModuleFolder{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Get-ModuleFolder' does not have a help comment. Note

The cmdlet 'Get-ModuleFolder' does not have a help comment.
Comment thread include/databaseV2.ps1

$function = "Invoke-$($MODULE_NAME)GetDbRootPath"
if(-not (Test-Path -Path function:$function)){

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
Comment thread include/databaseV2.ps1
}
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

Line has trailing whitespace
@rulasg rulasg merged commit 709b14b into main Aug 8, 2025
3 checks passed
@rulasg rulasg deleted the sync-include branch August 8, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants