Skip to content

Commit 9ca09d5

Browse files
minor updates
1 parent fe88ef9 commit 9ca09d5

8 files changed

Lines changed: 54 additions & 4 deletions

File tree

PSFramework/bin/PSFramework.dll

0 Bytes
Binary file not shown.

PSFramework/bin/PSFramework.pdb

0 Bytes
Binary file not shown.

PSFramework/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# CHANGELOG
22
## ???
3+
- New: Configuration validation: Credential. Validates PSCredential objects.
34
- Upd: Write-PSFMessage supports localized strings through the `-String` and `-StringValues` parameters
45
- Upd: Stop-PSFFunction supports localized strings through the `-String` and `-StringValues` parameters
6+
- Upd: Test-PSFShouldProcess now supports ShouldProcess itself. This should help silence tests on commands reyling on it.
57
- Upd: Message component supports localized strings
68
- Upd: Logging component logs in separate language than localized messages to screen / userinteraction
79
- Upd: Import-PSFLocalizedString now accepts wildcard path patterns that resovle to multiple files.
10+
- Upd: Adding tab completion for `Register-PSFTeppArgumentCompleter`
811
- fix: Missing localization strings
912

1013
## 0.10.30.165 : 2018-12-01
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Register-PSFConfigValidation -Name "credential" -ScriptBlock {
2+
param (
3+
$Value
4+
)
5+
6+
$Result = New-Object PSObject -Property @{
7+
Success = $True
8+
Value = $null
9+
Message = ""
10+
}
11+
try
12+
{
13+
if ($Value.GetType().FullName -ne "System.Management.Automation.PSCredential")
14+
{
15+
$Result.Message = "Not a credential: $Value"
16+
$Result.Success = $False
17+
return $Result
18+
}
19+
}
20+
catch
21+
{
22+
$Result.Message = "Not a credential: $Value"
23+
$Result.Success = $False
24+
return $Result
25+
}
26+
27+
$Result.Value = $Value
28+
29+
return $Result
30+
}

PSFramework/internal/tepp/scripts/tepp-scriptblockname.ps1

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Register-PSFTeppScriptblock -Name 'PSFramework-tepp-scriptblockname' -ScriptBlock {
2+
[PSFramework.TabExpansion.TabExpansionHost]::Scripts.Keys
3+
}
4+
5+
Register-PSFTeppScriptblock -Name 'PSFramework-tepp-parametername' -ScriptBlock {
6+
if ($fakeBoundParameter.Command)
7+
{
8+
$common = 'Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable', 'WhatIf', 'Confirm'
9+
10+
try
11+
{
12+
$command = Get-Command $fakeBoundParameter.Command
13+
if ($command -is [System.Management.Automation.AliasInfo]) { $command = $command.ResolvedCommand }
14+
$command.Parameters.Keys | Where-Object { $_ -notin $common }
15+
}
16+
catch { }
17+
}
18+
}

PSFramework/internal/tepp/tepp-assignment.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Register-PSFTeppArgumentCompleter -Command Import-PSFClixml -Parameter Encoding
6262

6363
#region Tab Completion
6464
Register-PSFTeppArgumentCompleter -Command Set-PSFTeppResult -Parameter TabCompletion -Name 'PSFramework-tepp-scriptblockname'
65+
Register-PSFTeppArgumentCompleter -Command Register-PSFTeppArgumentCompleter -Parameter Name -Name 'PSFramework-tepp-scriptblockname'
66+
Register-PSFTeppArgumentCompleter -Command Register-PSFTeppArgumentCompleter -Parameter Parameter -Name 'PSFramework-tepp-parametername'
6567
#endregion Tab Completion
6668

6769
#region Utility

library/PSFramework/Commands/TestPSFShouldProcessCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace PSFramework.Commands
55
/// <summary>
66
/// Implements the Test-PSFShouldProcess command
77
/// </summary>
8-
[Cmdlet("Test", "PSFShouldProcess")]
8+
[Cmdlet("Test", "PSFShouldProcess", SupportsShouldProcess = true)]
99
public class TestPSFShouldProcessCommand : Cmdlet
1010
{
1111
/// <summary>

0 commit comments

Comments
 (0)