Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c3f2c29
Upgrade to .NET 9 and update dependencies
Yevrag35 Aug 31, 2025
0f77da0
Add new references and implement read-only collections
Yevrag35 Aug 31, 2025
ee79386
Add StructLayout and Enumerator for SingleValueReadOnlySet
Yevrag35 Aug 31, 2025
3db11b6
Enhance null handling and type safety across modules
Yevrag35 Aug 31, 2025
2685efa
Add performance improvements and new features
Yevrag35 Sep 2, 2025
d928047
Remove ZLinq references and add EnumerableExtensions
Yevrag35 Sep 2, 2025
03e03b4
Update string comparison and streamline imports
Yevrag35 Sep 2, 2025
9a286e5
Add support for unsafe code and enhance list handling
Yevrag35 Sep 3, 2025
3668fbe
Enhance InputObject handling and enable nullable types
Yevrag35 Sep 3, 2025
7a6e60b
Add dictionary conversion features and nullable types
Yevrag35 Sep 3, 2025
6baa52b
Enhance ConvertToDictionaryCmdlet and add extensions
Yevrag35 Sep 5, 2025
d4dbc51
Enhance ValuePropertyName type and refactor ReplaceWithArgsZero
Yevrag35 Sep 5, 2025
1c053be
Add nullable types and improve documentation
Yevrag35 Sep 5, 2025
9106bb0
Add ListPool and refactor ListFunctions classes
Yevrag35 Sep 6, 2025
5952809
Refactor FindIndexCmdlet and enhance object pooling
MikeGarvey35 Sep 6, 2025
e6245ed
Enhance nullability support and pooling mechanisms
MikeGarvey35 Sep 6, 2025
f4593ca
Bump version to 3.0.0 and refactor codebase
MikeGarvey35 Sep 7, 2025
37bedb2
Refactor case sensitivity handling in EqualityConstructingCmdlet
MikeGarvey35 Sep 7, 2025
5480aad
Refactor cmdlets for improved structure and error handling
MikeGarvey35 Sep 7, 2025
c19b56e
Remove commented-out EndProcessing method
MikeGarvey35 Sep 7, 2025
5faaa9e
Remove ScriptBlockFilterOld and related classes
MikeGarvey35 Sep 7, 2025
1df1c56
Update handling of Debug.ps1 in project files
MikeGarvey35 Sep 7, 2025
0358795
Update ListFunctions module to version 3.0.0
MikeGarvey35 Sep 7, 2025
2c81451
Update ListFunctions module for PowerShell 5.1 support
MikeGarvey35 Sep 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ListFunctions/Core/ListFunctions.Engine.dll
Binary file not shown.
Binary file modified ListFunctions/Core/ListFunctions.Next.dll
Binary file not shown.
Binary file removed ListFunctions/Core/MG.Collections.Resources.dll
Binary file not shown.
Binary file removed ListFunctions/Core/MG.Collections.dll
Binary file not shown.
Binary file added ListFunctions/Core/ZLinq.dll
Binary file not shown.
Binary file modified ListFunctions/Desk/ListFunctions.Engine.dll
Binary file not shown.
Binary file modified ListFunctions/Desk/ListFunctions.NETFramework.dll
Binary file not shown.
Binary file removed ListFunctions/Desk/MG.Collections.Resources.dll
Binary file not shown.
Binary file removed ListFunctions/Desk/MG.Collections.dll
Binary file not shown.
17 changes: 7 additions & 10 deletions ListFunctions/ListFunctions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'ListFunctions.psm1'

# Version number of this module.
ModuleVersion = '2.0.0'
ModuleVersion = '3.0.0'

# Supported PSEditions
CompatiblePSEditions = @('Desk', 'Core')
Expand All @@ -27,7 +27,7 @@
CompanyName = 'Yevrag35, LLC.'

# Copyright statement for this module
Copyright = 'Copyright (c) 2020-2024 Yevrag35, LLC.'
Copyright = 'Copyright (c) 2020-2025 Yevrag35, LLC.'

# Description of the functionality provided by this module
Description = 'A simple module that provides functions to manipulate, search, and create Arrays, Collections, Lists, and Sets.'
Expand Down Expand Up @@ -75,7 +75,7 @@
CmdletsToExport = @(
'Assert-AllObject', 'Assert-AnyObject', 'Find-IndexOf',
'Find-LastIndexOf', 'New-Dictionary', 'New-HashSet', 'New-List',
'New-SortedSet'
'New-SortedSet', 'ConvertTo-Dictionary'
)

# Variables to export from this module
Expand All @@ -99,12 +99,9 @@
'ListFunctions.psm1',
'Core\ListFunctions.Engine.dll',
'Core\ListFunctions.Next.dll',
'Core\MG.Collections.dll',
'Core\MG.Collections.Resources.dll',
'Core\ZLinq.dll',
'Desk\ListFunctions.Engine.dll',
'Desk\ListFunctions.NETFramework.dll',
'Desk\MG.Collections.dll',
'Desk\MG.Collections.Resources.dll'
'Desk\ListFunctions.NETFramework.dll'
)

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
Expand All @@ -115,7 +112,7 @@
# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('All', 'Any', 'Array', 'Assert', 'bool', 'Collection', 'compare', 'Condition',
'count', 'Enumerable', 'equality', 'Find', 'HashSet', 'index', 'Last', 'Linq',
'List', 'Modify', 'Predicate', 'Remove', 'set', 'sort', 'Test', 'Where')
'List', 'Modify', 'Predicate', 'Remove', 'set', 'sort', 'Test', 'Where', 'Convert', 'ConvertTo')

# A URL to the license for this module.
LicenseUri = 'https://raw.githubusercontent.com/Yevrag35/PowerShell-ListFunctions/master/LICENSE'
Expand All @@ -129,7 +126,7 @@
# Prerelease = 'beta'

# ReleaseNotes of this module
ReleaseNotes = 'Overhaul of all cmdlets and moved to binary module for performance improvements.'
ReleaseNotes = 'Refactoring work to improve performance and reduce overhead. Utilizes ZLinq library for PowerShell 7 version for further gains.'

} # End of PSData hashtable

Expand Down
12 changes: 3 additions & 9 deletions ListFunctions/ListFunctions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
default { throw "Incompatible PowerShell Version" }
}

$script:assFolder = Split-Path -Path $script:dllPath -Parent
$script:loadThese = @(
'MG.Collections.dll',
'ListFunctions.Engine.dll'
)
# foreach ($script:assName in $script:loadThese) {

foreach ($script:assName in $script:loadThese) {

Import-Module "$($script:assFolder)\$($script:assName)"
}
# Import-Module "$($script:assFolder)\$($script:assName)"
# }

Import-Module $script:dllPath -ErrorAction Stop
4 changes: 2 additions & 2 deletions src/engine/LFPublish/LFPublish.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SignAssembly>true</SignAssembly>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Management.Automation" Version="7.4.0" />
<PackageReference Include="System.Management.Automation" Version="7.5.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ListFunctions</RootNamespace>
<AssemblyName>ListFunctions.NETFramework</AssemblyName>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<Version>2.0.0</Version>
<AssemblyVersion>3.0.0</AssemblyVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<FileVersion>3.0.0</FileVersion>
<Version>3.0.0</Version>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand All @@ -40,20 +41,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MG.Collections, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MG.Collections.1.2.0\lib\net462\MG.Collections.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Nullable\AllowNullAttribute.cs" />
Expand All @@ -69,21 +61,30 @@
<Compile Include="Nullable\NotNullWhenAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Release'">
<Content Include="Debug.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<Content Include="Debug.ps1">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\ListFunctions-Next\**\*.cs" Exclude="..\ListFunctions-Next\obj\**\*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ListFunctions.Engine\ListFunctions.Engine.csproj">
<Project>{515aa5f2-1c73-4556-a519-c2ff18b423f4}</Project>
<Name>ListFunctions.Engine</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ListFunctions-Next\**\*.cs" Exclude="..\ListFunctions-Next\obj\**\*.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0")]
[assembly: AssemblyFileVersion("2.0.0")]
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.0")]
23 changes: 23 additions & 0 deletions src/engine/ListFunctions-NETFramework/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
9 changes: 7 additions & 2 deletions src/engine/ListFunctions-NETFramework/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MG.Collections" version="1.2.0" targetFramework="net471" />
<package id="Microsoft.PowerShell.5.ReferenceAssemblies" version="1.1.0" targetFramework="net48" />
<package id="Microsoft.Bcl.Memory" version="9.0.6" targetFramework="net471" />
<package id="Microsoft.PowerShell.5.ReferenceAssemblies" version="1.1.0" targetFramework="net471" />
<package id="Nullable" version="1.3.1" targetFramework="net48" developmentDependency="true" />
<package id="System.Buffers" version="4.6.1" targetFramework="net471" />
<package id="System.Memory" version="4.6.3" targetFramework="net471" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net471" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net471" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,63 @@
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading.Tasks;

#nullable enable

namespace ListFunctions.Cmdlets.Assertions
{
[Cmdlet(VerbsLifecycle.Assert, "AllObject")]
[Alias("Assert-AllObjects", "Assert-All", "All", "All-Object", "All-Objects")]
[OutputType(typeof(bool))]
public sealed class AssertAllObjectsCmdlet : ListFunctionCmdletBase
public sealed class AssertAllObjectsCmdlet : AssertObjectCmdlet
{
ScriptBlockFilter<object> _equality = null!;
bool _stop;

[Parameter(Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyCollection]
[AllowNull]
public object[] InputObject { get; set; } = null!;

[Parameter(Mandatory = true, Position = 0)]
[Alias("ScriptBlock")]
[Alias("ScriptBlock", "FilterScript")]
[AllowNull, AllowEmptyString]
[ValidateScriptVariable(PSThisVariable.UNDERSCORE_NAME, PSThisVariable.THIS_NAME, PSThisVariable.PSITEM_NAME)]
public ScriptBlock Condition { get; set; } = null!;
public override ScriptBlock? Condition
{
get => base.Condition;
set => base.Condition = value;
}

[Parameter(Mandatory = true, ValueFromPipeline = true)]
[AllowNull, AllowEmptyCollection, AllowEmptyString]
public object?[]? InputObject { get; set; }

[Parameter]
public ActionPreference ScriptBlockErrorAction { get; set; } = ActionPreference.SilentlyContinue;
public override ActionPreference ScriptBlockErrorAction { get; set; } = ActionPreference.SilentlyContinue;

protected override void BeginProcessing()
{
_equality = new ScriptBlockFilter<object>(this.Condition, EnumerateVariables(this.ScriptBlockErrorAction));
}
protected override void ProcessRecord()
protected override bool Process(ScriptBlockFilter filter)
{
if (!_stop)
{
_stop = !_equality.All(this.InputObject);
}
return !filter.All(this.InputObject);
}
protected override void EndProcessing()

[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0009:Member access should be qualified.", Justification = "Used in nameof()")]
protected override bool ProcessWhenNoCondition()
{
this.WriteObject(_stop);
throw new ArgumentException("Asserting an all-true condition requires a condition to be specified.", nameof(Condition));
}

private static IEnumerable<PSVariable> EnumerateVariables(ActionPreference errorPref)
protected override void End(bool scriptResult)
{
yield return new PSVariable(ERROR_ACTION_PREFERENCE, errorPref);
this.WriteObject(!scriptResult);
}

//protected override void BeginProcessing()
//{
// _equality = new ScriptBlockFilter(this.Condition, new PSVariable(ERROR_ACTION_PREFERENCE, this.ScriptBlockErrorAction));
//}
//protected override void ProcessRecord()
//{
// if (!_stop)
// {
// _stop = !_equality.All(this.InputObject);
// }
//}
//protected override void EndProcessing()
//{
// this.WriteObject(_stop);
//}
}
}
Loading