Skip to content

Commit f0fd300

Browse files
committed
Version 1.0.3.2
1 parent 1c63cd1 commit f0fd300

File tree

47 files changed

+543
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+543
-171
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ You could see PowerCommands as your CLI application starter kit. It is a structu
33

44
[Follow progress on twitter](https://twitter.com/PowerCommands) <img src="https://github.com/PowerCommands/PowerCommands2022/blob/main/Docs/images/Twitter.png?raw=true" alt="drawing" width="20"/>
55

6+
## Version 1.0.3.2
7+
**Released 2023-12-26**
8+
- `DialogService.ListDialog` has major improvements with paging and select all functionality and have been moved to a new service, named `ListService`.
9+
- `ProxyCommand` now handles suggestion overrides in configuration.
10+
- `ConsoleTableService.RenderTable` generic constraint new() removed since it is not needed.
11+
- Bookmarks in `CdCommand` now handles `%USERNAME%` as a placeholder for current user in paths.
12+
613
## Version 1.0.3.1
714
**Released 2023-11-30**
815
- Adjusted the Power Command to be run with a service account and use encryption, update the setup to reflect this.

Templates/PowerCommands.zip

2.75 KB
Binary file not shown.

Templates/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ I recommend you to use the option ```Place solution in the same directory``` som
1616
![Alt text](../Docs/images/VS_solution_option.png?raw=true "Command Base")
1717

1818
# What is new?
19+
## Version 1.0.3.2
20+
**Released 2023-12-26**
21+
- `DialogService.ListDialog` has major improvements with paging and select all functionality and have been moved to a new service, named `ListService`.
22+
- `ProxyCommand` now handles suggestion overrides in configuration.
23+
- `ConsoleTableService.RenderTable` generic constraint new() removed since it is not needed.
24+
- Bookmarks in `CdCommand` now handles `%USERNAME%` as a placeholder for current user in paths.
1925
## Version 1.0.3.1
2026
**Released 2023-11-30**
2127
- Adjusted the Power Command to be run with a service account and use encryption, update the setup to reflect this.

Templates/src/Core/PainKiller.PowerCommands.Configuration/DOMAINOBJECTS/ConfigurationGlobals.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public static class ConfigurationGlobals
88
public const string WhatsNewFileName = "whats_new.md";
99
public const char ArraySplitter = '|';
1010
public const string SetupConfigurationFile = "setup.yaml";
11-
public const string EncryptionEnviromentVariableName = "_encryptionManager";
11+
public const string EncryptionEnvironmentVariableName = "_encryptionManager";
1212

1313
public static readonly string ApplicationDataFolder = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\{nameof(PowerCommands)}";
14+
public static readonly string MainConfigurationFileFullPath = Path.Combine(AppContext.BaseDirectory, MainConfigurationFile);
1415
}

Templates/src/Core/PainKiller.PowerCommands.Configuration/PainKiller.PowerCommands.Configuration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
55
<LangVersion>12.0</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
<Version>1.0.3.1</Version>
8+
<Version>1.0.3.2</Version>
99
</PropertyGroup>
1010

1111
<ItemGroup>

Templates/src/Core/PainKiller.PowerCommands.Core/COMMANDS/CdCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public override RunResult Run()
6565
if(!string.IsNullOrEmpty(dir)) paths.Add(dir);
6666
path = string.Join(Path.DirectorySeparatorChar, paths);
6767
}
68+
path = path.Replace("%USERNAME%", Environment.UserName, StringComparison.CurrentCultureIgnoreCase);
6869
if (path.Contains("$ROAMING$")) path = path.Replace("$ROAMING$", ConfigurationGlobals.ApplicationDataFolder);
6970
if (Directory.Exists(path)) WorkingDirectory = $"{Path.GetFullPath(path)}";
7071
else WriteFailureLine($"[{path}] does not exist");

Templates/src/Core/PainKiller.PowerCommands.Core/MyTemplate.vstemplate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<ProjectItem ReplaceParameters="true" TargetFileName="HelpService.cs">HelpService.cs</ProjectItem>
6969
<ProjectItem ReplaceParameters="true" TargetFileName="HtmlConsoleService.cs">HtmlConsoleService.cs</ProjectItem>
7070
<ProjectItem ReplaceParameters="true" TargetFileName="IOService.cs">IOService.cs</ProjectItem>
71+
<ProjectItem ReplaceParameters="true" TargetFileName="ListService.cs">ListService.cs</ProjectItem>
7172
<ProjectItem ReplaceParameters="true" TargetFileName="PauseService.cs">PauseService.cs</ProjectItem>
7273
<ProjectItem ReplaceParameters="true" TargetFileName="ReflectionService.cs">ReflectionService.cs</ProjectItem>
7374
<ProjectItem ReplaceParameters="true" TargetFileName="ShellService.cs">ShellService.cs</ProjectItem>

Templates/src/Core/PainKiller.PowerCommands.Core/PainKiller.PowerCommands.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<LangVersion>12.0</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
<Version>1.0.3.1</Version>
8+
<Version>1.0.3.2</Version>
99
</PropertyGroup>
1010

1111
<ItemGroup>

Templates/src/Core/PainKiller.PowerCommands.Core/PowerCommandsRuntime.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ private void Initialize()
3030
var identifierAlias = command.Contains($"|") ? identifiers[1] : identifier;
3131
ConsoleService.Service.WriteLine("PowerCommandsRuntime", $"Proxy command [{identifierAlias}] added");
3232
var powerCommand = new ProxyCommando(identifier, _configuration, proxyCommand.Name, proxyCommand.WorkingDirctory, identifierAlias);
33-
SuggestionProviderManager.AddContextBoundSuggestions(identifierAlias, new[] { "--retry-interval-seconds", "--no-quit","--help" });
33+
34+
var suggestions = new List<string>{"--retry-interval-seconds", "--no-quit","--help" };
35+
var commandDesignOverrides = _configuration.CommandDesignOverrides.FirstOrDefault(c => c.Name == identifier);
36+
if (commandDesignOverrides != null) suggestions.AddRange(commandDesignOverrides.Suggestions.Split('|'));
37+
SuggestionProviderManager.AddContextBoundSuggestions(identifierAlias, suggestions.ToArray());
3438
if(Commands.All(c => c.Identifier != powerCommand.Identifier)) Commands.Add(powerCommand);
3539
else ConsoleService.Service.WriteWarning("PowerCommandsRuntime", $"A command with the same identifier [{command}] already exist, proxy command not added.");
3640
}

Templates/src/Core/PainKiller.PowerCommands.Core/SERVICES/ConsoleTableService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ namespace $safeprojectname$.Services;
44
public static class ConsoleTableService
55
{
66
private static readonly Dictionary<string, IEnumerable<IColumnRender>> TableColumnRenderDefinitions = new();
7-
public static void RenderTable<T>(IEnumerable<T> items, IConsoleWriter consoleWriter) where T : new()
7+
public static void RenderTable<T>(IEnumerable<T> items, IConsoleWriter consoleWriter)
88
{
99
var tableItems = items.ToArray();
1010
if (!tableItems.Any()) return;
1111
var rows = ConsoleTable
12-
.From<T>(tableItems)
12+
.From(tableItems)
1313
.Configure(o => o.NumberAlignment = Alignment.Right)
1414
.Read(WriteFormat.Alternative).Split("\r\n");
1515
RenderConsoleTable(rows, consoleWriter);
@@ -25,7 +25,7 @@ public static class ConsoleTableService
2525
return;
2626
}
2727
var rows = ConsoleTable
28-
.From<T>(tableItems)
28+
.From(tableItems)
2929
.Configure(o => o.NumberAlignment = Alignment.Right)
3030
.Read(WriteFormat.Alternative).Split("\r\n");
3131
RenderConsoleTable(rows, consoleWriter);
@@ -64,7 +64,7 @@ public static void AddTableColumnRenderDefinitions(string name, IEnumerable<ICol
6464
private static void RenderTable<T>(IEnumerable<T> tableData, ColumnRenderOptionsAttribute[] columnRenderDefinitions, IConsoleWriter consoleWriter)
6565
{
6666
var rows = ConsoleTable
67-
.From<T>(tableData)
67+
.From(tableData)
6868
.Configure(o => o.NumberAlignment = Alignment.Right)
6969
.Read(WriteFormat.Alternative).Split("\r\n");
7070

0 commit comments

Comments
 (0)