2023-11-19 17:41:58

This commit is contained in:
z17CX 2023-11-19 17:41:58 +00:00
parent 564f46ad1e
commit b1d7298b25
Signed by: z17cx
GPG Key ID: 3F5F87C84EE943E4
3 changed files with 20 additions and 10 deletions

View File

@ -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 {

View File

@ -1,8 +1,10 @@
function Start-cURL {
<#
.SYNOPSIS
Running cURL.
.DESCRIPTION
Checking the location of the program files and launching the program.
#>
param(

View File

@ -1,8 +1,16 @@
function Start-cURLDownload() {
<#
.SYNOPSIS
Downloading data.
.DESCRIPTION
Downloading data using cURL.
.PARAMETER URL
URL to the data to be downloaded.
.EXAMPLE
Start-cURLDownload -URL 'https://mirror.yandex.ru/debian-cd/current/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso'
#>
param(
@ -10,9 +18,9 @@ function Start-cURLDownload() {
)
$URL | ForEach-Object {
$Param = @('--location') # If the server reports that the requested page has moved to a different location.
$Param += @('--remote-name') # Write output to a local file named like the remote file we get.
$Param += @("${_}") # Input URL.
$Param = @('--location') # If the server reports that the requested page has moved to a different location.
$Param += @('--remote-name') # Write output to a local file named like the remote file we get.
$Param += @("${_}") # Input URL.
& $(Start-cURL) $Param
}