Skip to content

Commit

Permalink
Merge pull request #71 from fscpscollaborative/develop
Browse files Browse the repository at this point in the history
Release merge
  • Loading branch information
onikolaiev authored Jul 19, 2024
2 parents e9f7017 + 7b6ee59 commit f4365c1
Show file tree
Hide file tree
Showing 15 changed files with 365 additions and 100 deletions.
17 changes: 16 additions & 1 deletion docs/Invoke-FSCPSChoco.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Install software from Choco
## SYNTAX

```
Invoke-FSCPSChoco [-Command] <String> [[-RemainingArguments] <Object>] [-Silent] [-Force]
Invoke-FSCPSChoco [-Command] <String> [[-RemainingArguments] <Object>] [-Silent] [-SkipUpdate] [-Force]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

Expand Down Expand Up @@ -80,6 +80,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -SkipUpdate
Skip the chocolatey update
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Force
Force command.
Reinstall latest version if command is install or upgrade to latest version
Expand Down
46 changes: 18 additions & 28 deletions fscps.tools/fscps.tools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Oleksandr Nikolaiev
#
# Generated on: 6/7/2024
# Generated on: 7/15/2024
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'fscps.tools.psm1'

# Version number of this module.
ModuleVersion = '1.0.225'
ModuleVersion = '1.0.263'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -72,31 +72,20 @@ FormatsToProcess = 'xml\fscps.tools.Format.ps1xml'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
'Get-FSCPSSettings',
'Set-FSCPSSettings',
'Invoke-FSCPSChoco',
'Get-FSCPSNuget',
'Get-FSCPSVersionInfo',
'Invoke-FSCPSCompile',
'Install-FSCPSNugetCLI',
'Find-FSCPSCommand',
'Disable-FSCPSException',
'Enable-FSCPSException',
'Get-FSCPSAzureStorageFile',
'Update-FSCPSModelVersion',
'Invoke-FSCPSDigiCertSignFile',
'Invoke-FSCPSAzureSignToolSignFile',
'Add-FSCPSAzureStorageConfig',
'Get-FSCPSAzureStorageConfig',
'Get-FSCPSActiveAzureStorageConfig',
'Register-FSCPSAzureStorageConfig',
'Set-FSCPSActiveAzureStorageConfig',
'Invoke-FSCPSAzureStorageDownload',
'Invoke-FSCPSAzureStorageUpload',
'Invoke-FSCPSAzureStorageDelete',
'Update-FSCPSISVSource'
)
FunctionsToExport = 'Get-FSCPSSettings', 'Set-FSCPSSettings', 'Invoke-FSCPSChoco',
'Get-FSCPSNuget', 'Get-FSCPSVersionInfo', 'Invoke-FSCPSCompile',
'Install-FSCPSNugetCLI', 'Find-FSCPSCommand',
'Disable-FSCPSException', 'Enable-FSCPSException',
'Get-FSCPSAzureStorageFile', 'Update-FSCPSModelVersion',
'Invoke-FSCPSDigiCertSignFile', 'Invoke-FSCPSAzureSignToolSignFile',
'Add-FSCPSAzureStorageConfig', 'Get-FSCPSAzureStorageConfig',
'Get-FSCPSActiveAzureStorageConfig',
'Register-FSCPSAzureStorageConfig',
'Set-FSCPSActiveAzureStorageConfig',
'Invoke-FSCPSAzureStorageDownload',
'Invoke-FSCPSAzureStorageUpload', 'Invoke-FSCPSAzureStorageDelete',
'Update-FSCPSISVSource'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

Expand Down Expand Up @@ -154,4 +143,5 @@ PrivateData = @{
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
}

7 changes: 6 additions & 1 deletion fscps.tools/functions/get-fscpsversioninfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ Function Get-FSCPSVersionInfo {
$VersionStrategy = Get-PSFConfigValue -FullName "fscps.tools.settings.all.versionStrategy"
$versionsDefaultFile = Join-Path "$Script:DefaultTempPath" "versions.default.json"

Invoke-FSCPSWebRequest -method GET -Uri "https://raw.githubusercontent.com/fscpscollaborative/fscps/main/Actions/Helpers/versions.default.json" -outFile $versionsDefaultFile
try {
Invoke-FSCPSWebRequest -method GET -Uri "https://raw.githubusercontent.com/fscpscollaborative/fscps/main/Actions/Helpers/versions.default.json" -outFile $versionsDefaultFile
}
catch {
Start-BitsTransfer -Source "https://raw.githubusercontent.com/fscpscollaborative/fscps/main/Actions/Helpers/versions.default.json" -Destination $versionsDefaultFile
}

$versionsData = (Get-Content $versionsDefaultFile) | ConvertFrom-Json

Expand Down
21 changes: 14 additions & 7 deletions fscps.tools/functions/invoke-fscpschoco.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
.PARAMETER Silent
Disable output
.PARAMETER SkipUpdate
Skip the chocolatey update
.PARAMETER Command
The command of the choco to execute
Expand Down Expand Up @@ -44,20 +47,24 @@ Function Invoke-FSCPSChoco {
[string] $Command,
[Parameter(Mandatory = $false, Position = 1, ValueFromRemainingArguments = $true)] $RemainingArguments,
[switch] $Silent,
[switch] $SkipUpdate,
[switch] $Force
)

BEGIN {
Invoke-TimeSignal -Start
try {
if (Test-Path -Path "$env:ProgramData\Chocolatey") {
if (!$Silent) {
choco upgrade chocolatey -y -r
choco upgrade all --ignore-checksums -y -r
}
else{
$null = choco upgrade chocolatey -y -r -silent
$null = choco upgrade all --ignore-checksums -y -r
if($SkipUpdate)
{
if (!$Silent) {
choco upgrade chocolatey -y -r
choco upgrade all --ignore-checksums -y -r
}
else{
$null = choco upgrade chocolatey -y -r -silent
$null = choco upgrade all --ignore-checksums -y -r
}
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion fscps.tools/functions/invoke-fscpscompile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.PARAMETER BuildFolderPath
The destination build folder
.PARAMETER OutputAsHashtable
Instruct the cmdlet to return a hashtable object
Expand Down
7 changes: 6 additions & 1 deletion fscps.tools/functions/set-fscpssettings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,13 @@ function Set-FSCPSSettings {
}
}
else {
Write-PSFMessage -Level Verbose -Message "Searching fscps.tools.settings.*.$prop"
$setting = Get-PSFConfig -FullName "fscps.tools.settings.*.$prop"
Set-PSFConfig -FullName $setting.FullName -Value $srcProp
Write-PSFMessage -Level Verbose -Message "Found $setting"
if($setting)
{
Set-PSFConfig -FullName $setting.FullName -Value $srcProp
}
#$dst."$prop" = $srcProp
}
}
Expand Down
Loading

0 comments on commit f4365c1

Please sign in to comment.