diff --git a/PkgStore.Kernel.psm1 b/PkgStore.Kernel.psm1 index 4138d41..6c19ec9 100644 --- a/PkgStore.Kernel.psm1 +++ b/PkgStore.Kernel.psm1 @@ -1,9 +1,9 @@ -$ModuleManifest = (Get-ChildItem -Path $PSScriptRoot | Where-Object {$_.Extension -eq '.psd1'}) +$ModuleManifest = (Get-ChildItem -Path $PSScriptRoot | Where-Object { $_.Extension -eq '.psd1' }) $CurrentManifest = (Test-ModuleManifest $ModuleManifest) $Aliases = @() -$PrivateFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Private') | Where-Object {$_.Extension -eq '.ps1'}) -$PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Where-Object {$_.Extension -eq '.ps1'}) +$PrivateFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Private') | Where-Object { $_.Extension -eq '.ps1' }) +$PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Where-Object { $_.Extension -eq '.ps1' }) (@($PrivateFunctions) + @($PublicFunctions)) | ForEach-Object { try { @@ -25,10 +25,10 @@ $PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Whe } } -$FunctionsAdded = ($PublicFunctions | Where-Object {$_.BaseName -notin $CurrentManifest.ExportedFunctions.Keys}) -$FunctionsRemoved = ($CurrentManifest.ExportedFunctions.Keys | Where-Object {$_ -notin $PublicFunctions.BaseName}) -$AliasesAdded = ($Aliases | Where-Object {$_ -notin $CurrentManifest.ExportedAliases.Keys}) -$AliasesRemoved = ($CurrentManifest.ExportedAliases.Keys | Where-Object {$_ -notin $Aliases}) +$FunctionsAdded = ($PublicFunctions | Where-Object { $_.BaseName -notin $CurrentManifest.ExportedFunctions.Keys }) +$FunctionsRemoved = ($CurrentManifest.ExportedFunctions.Keys | Where-Object { $_ -notin $PublicFunctions.BaseName }) +$AliasesAdded = ($Aliases | Where-Object { $_ -notin $CurrentManifest.ExportedAliases.Keys }) +$AliasesRemoved = ($CurrentManifest.ExportedAliases.Keys | Where-Object { $_ -notin $Aliases }) if ($FunctionsAdded -or $FunctionsRemoved -or $AliasesAdded -or $AliasesRemoved) { try { diff --git a/Public/Copy-Data.ps1 b/Public/Copy-Data.ps1 index 3f21d8d..dc0db6c 100644 --- a/Public/Copy-Data.ps1 +++ b/Public/Copy-Data.ps1 @@ -1,8 +1,19 @@ function Copy-Data() { <# .SYNOPSIS + Copying data. .DESCRIPTION + Copying data using the 'Copy-Item' cmdlet with '-LiteralPath'. + + .PARAMETER SRC + Source data. + + .PARAMETER DST + Destination. + + .EXAMPLE + Copy-Data -SRC 'C:\File.TXT' -DST 'D:\File.TXT' #> param( diff --git a/Public/Move-Data.ps1 b/Public/Move-Data.ps1 index 39598a8..55bd38e 100644 --- a/Public/Move-Data.ps1 +++ b/Public/Move-Data.ps1 @@ -1,8 +1,19 @@ function Move-Data() { <# .SYNOPSIS + Moving data. .DESCRIPTION + Moving data using the 'Move-Item' cmdlet with '-LiteralPath'. + + .PARAMETER SRC + Source data. + + .PARAMETER DST + Destination. + + .EXAMPLE + Copy-Data -SRC 'C:\File.TXT' -DST 'D:\File.TXT' #> param( diff --git a/Public/New-Data.ps1 b/Public/New-Data.ps1 index 1d10623..9c1beb7 100644 --- a/Public/New-Data.ps1 +++ b/Public/New-Data.ps1 @@ -1,8 +1,27 @@ function New-Data() { <# .SYNOPSIS + Creating data. .DESCRIPTION + Creating data using the 'New-Item' cmdlet. + + .PARAMETER Type + The type of data to be created: + 'D' | Directory. + 'F' | File. + + .PARAMETER Path + The path of the data being created. + + .PARAMETER Name + The name of the data to be created. + + .PARAMETER Action + Action when creating data. + + .EXAMPLE + New-Data -Type 'F' -Path 'C:\DATA' -Name 'File.TXT' #> param( diff --git a/Public/Remove-Data.ps1 b/Public/Remove-Data.ps1 index dba71cb..c588f3d 100644 --- a/Public/Remove-Data.ps1 +++ b/Public/Remove-Data.ps1 @@ -1,8 +1,16 @@ function Remove-Data() { <# .SYNOPSIS + Deleting data. .DESCRIPTION + Removing data using the 'Remove-Item' cmdlet with '-LiteralPath'. + + .PARAMETER Path + Path to the data to be deleted. + + .EXAMPLE + Remove-Data -Path 'C:\File.TXT' #> param( diff --git a/Public/Test-Data.ps1 b/Public/Test-Data.ps1 index af10b4f..fa6950e 100644 --- a/Public/Test-Data.ps1 +++ b/Public/Test-Data.ps1 @@ -1,8 +1,21 @@ function Test-Data() { <# .SYNOPSIS + Checking data. .DESCRIPTION + Checking data using the 'Test-Path' cmdlet with '-LiteralPath'. + + .PARAMETER Type + Type of data being checked: + 'D' | Container. + 'F' | Leaf. + + .PARAMETER Path + Path to the data being checked. + + .EXAMPLE + Test-Data -Type 'F' -Path 'C:\File.TXT' #> param( diff --git a/Public/Test-Module.ps1 b/Public/Test-Module.ps1 index d4e466d..709e686 100644 --- a/Public/Test-Module.ps1 +++ b/Public/Test-Module.ps1 @@ -1,8 +1,16 @@ function Test-Module() { <# .SYNOPSIS + Checking the module. .DESCRIPTION + Checking that the module is loaded correctly. + + .PARAMETER Names + Names of the modules being checked. + + .EXAMPLE + Test-Module -Names 'Module.Name01', 'Module.Name02', 'Module.Name03' #> param( diff --git a/Public/Write-Msg.ps1 b/Public/Write-Msg.ps1 index aeae0b0..4e101e1 100644 --- a/Public/Write-Msg.ps1 +++ b/Public/Write-Msg.ps1 @@ -1,8 +1,29 @@ function Write-Msg() { <# .SYNOPSIS + Display messages. .DESCRIPTION + Display messages depending on their type. + + .PARAMETER Type + The type of message to be displayed: + 'HL' | Write-Host (Title). + 'I' | Write-Information. + 'W' | Write-Warning. + 'E' | Write-Error. + + .PARAMETER Message + Contents of the message to be displayed. + + .PARAMETER Action + Action when a message is displayed. + + .EXAMPLE + Write-Msg -Type 'HL' -Message 'Title message' + + .EXAMPLE + Write-Msg -Type 'E' -Message 'File not found!' -Action 'Stop' #> param(