Skip to content

Commit af3552d

Browse files
Merge pull request #257 from PowershellFrameworkCollective/development
0.10.30.165
2 parents d35aa04 + 04adb0f commit af3552d

File tree

25 files changed

+344
-71
lines changed

25 files changed

+344
-71
lines changed

PSFramework/PSFramework.psd1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RootModule = 'PSFramework.psm1'
66

77
# Version number of this module.
8-
ModuleVersion = '0.10.29.160'
8+
ModuleVersion = '0.10.30.165'
99

1010
# ID used to uniquely identify this module
1111
GUID = '8028b914-132b-431f-baa9-94a6952f21ff'
@@ -93,6 +93,7 @@
9393
'Import-PSFLocalizedString',
9494
'Install-PSFLoggingProvider',
9595
'Invoke-PSFCommand',
96+
'Join-PSFPath',
9697
'New-PSFLicense',
9798
'New-PSFMessageLevelModifier',
9899
'New-PSFSupportPackage',
@@ -107,6 +108,7 @@
107108
'Register-PSFTeppArgumentCompleter',
108109
'Register-PSFTeppScriptblock',
109110
'Register-PSFTypeSerializationData',
111+
'Remove-PSFAlias',
110112
'Remove-PSFLicense',
111113
'Remove-PSFMessageLevelModifier',
112114
'Reset-PSFConfig',

PSFramework/PSFramework.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function Import-ModuleFile
5858
if ($doDotSource) { . (Resolve-Path $Path) }
5959
else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText((Resolve-Path $Path).ProviderPath))), $null, $null) }
6060
}
61-
catch { throw (New-Object System.Exception("Failed to import $(Resolve-Path $Path) _ $_", $_.Exception)) }
61+
catch { throw (New-Object System.Exception("Failed to import $(Resolve-Path $Path) : $_", $_.Exception)) }
6262
}
6363

6464
#region Load individual files

PSFramework/bin/PSFramework.dll

1.5 KB
Binary file not shown.

PSFramework/bin/PSFramework.pdb

0 Bytes
Binary file not shown.

PSFramework/bin/PSFramework.xml

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PSFramework/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# CHANGELOG
2+
## 0.10.30.165 : 2018-12-01
3+
- New: Command Join-PSFPath performs multi-segment path joins and path normalization
4+
- New: Command Remove-PSFAlias deletes global aliases
5+
- New: Configuration setting to define current language
6+
- Upd: PsfValidatePattern now supports localized strings using the `ErrorString` property.
7+
- Fix: Race condition / concurrent access on license content during import with ramping up CPU availability
8+
29
## 0.10.29.160 : 2018-11-04
310
- New: Command ConvertTo-PSFHashtable converts objects into hashtables
411
- New: Command Get-PSFPipeline grants access to the current pipeline and all its works.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@{
2+
Assembly_UtilityHost_AliasNotFound = 'Failed to find alias: {0}'
3+
Assembly_UtilityHost_AliasProtected = 'The alias "{0}" is protected and cannot be removed!'
4+
Assembly_UtilityHost_AliasReadOnly = 'The alias "{0}" is read only! To remove it, also specify the "-Force" parameter.'
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@{
2+
Configuration_ValidateLanguage = '{0} is not recognized as a legal language code, such as "en-US" or "de-DE"'
3+
}

PSFramework/functions/license/Get-PSFLicense.ps1

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
3232
Returns a list of all registered licenses for products that have commercial licenses and are libraries.
3333
#>
34-
3534
[CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLicense')]
3635
[OutputType([PSFramework.License.License])]
3736
param (
@@ -50,31 +49,11 @@
5049
$Manufacturer = "*"
5150
)
5251

53-
$licenses = [PSFramework.License.LicenseHost]::Get() | Where-Object { ($_.Product -like $Filter) -and ($_.Manufacturer -like $Manufacturer) }
54-
if ($PSBoundParameters.ContainsKey("ProductType"))
55-
{
56-
$temp = $licenses
57-
$licenses = @()
58-
59-
:main foreach ($l in $temp)
60-
{
61-
foreach ($type in $ProductType)
62-
{
63-
if ($l.ProductType -eq $type)
64-
{
65-
$licenses += $l
66-
continue main
67-
}
68-
}
69-
}
70-
}
71-
72-
if ($PSBoundParameters.ContainsKey("LicenseType"))
73-
{
74-
$licenses | Where-Object { ($_.LicenseType.ToString() -match $LicenseType.ToString()) -and ($_.Manufacturer -like $Manufacturer) -and ($_.Product -like $Filter) }
75-
}
76-
else
77-
{
78-
$licenses | Where-Object { ($_.Manufacturer -like $Manufacturer) -and ($_.Product -like $Filter) }
52+
[PSFramework.License.LicenseHost]::Get() | Where-Object {
53+
if ($_.Product -notlike $Filter) { return $false }
54+
if ($_.Manufacturer -notlike $Manufacturer) { return $false }
55+
if ($ProductType -and ($_.ProductType -notin $ProductType)) { return $false }
56+
if ($licenseType -and -not ($_.LicenseType -band $LicenseType)) { return $false }
57+
return $true
7958
}
8059
}

PSFramework/functions/license/New-PSFLicense.ps1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
8181
This registers the Awesome Test Product as licensed under the common FreeBSD license.
8282
#>
83-
8483
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/New-PSFLicense')]
8584
[OutputType([PSFramework.License.License])]
8685
param
@@ -123,21 +122,22 @@
123122
)
124123

125124
# Create and fill object
126-
$license = New-Object PSFramework.License.License
127-
$license.Product = $Product
128-
$license.Manufacturer = $Manufacturer
129-
$license.ProductVersion = $ProductVersion
130-
$license.ProductType = $ProductType
131-
$license.LicenseName = $Name
132-
$license.LicenseVersion = $Version
133-
$license.LicenseDate = $Date
134-
$license.LicenseType = $Type
135-
$license.LicenseText = $Text
136-
$license.Description = $Description
137-
$license.Parent = $Parent
125+
$license = New-Object PSFramework.License.License -Property @{
126+
Product = $Product
127+
Manufacturer = $Manufacturer
128+
ProductVersion = $ProductVersion
129+
ProductType = $ProductType
130+
LicenseName = $Name
131+
LicenseVersion = $Version
132+
LicenseDate = $Date
133+
LicenseType = $Type
134+
LicenseText = $Text
135+
Description = $Description
136+
Parent = $Parent
137+
}
138138
if ($PSCmdlet.ShouldProcess("$($license.Product) $($license.ProductVersion) ($($license.LicenseName))", "Create License"))
139139
{
140-
if (-not ([PSFramework.License.LicenseHost]::Get() | Where-Object { ($_.Product -eq $license.Product) -and ($_.ProductVersion -eq $license.ProductVersion) }))
140+
if (-not ([PSFramework.License.LicenseHost]::Get($license)))
141141
{
142142
[PSFramework.License.LicenseHost]::Add($license)
143143
}

0 commit comments

Comments
 (0)