This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Native { | |
[CmdletBinding(SupportsShouldProcess)] | |
param( | |
[Parameter(Mandatory, Position = 0, ValueFromPipeline)] | |
[scriptblock[]] | |
$Call | |
) | |
process { | |
foreach ($item in $Call) { | |
$invocation = $ExecutionContext.InvokeCommand.ExpandString($item).Trim() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
[Parameter()] | |
[switch] | |
$InternalOnly | |
) | |
$ErrorActionPreference = 'Stop' | |
function Invoke-Native { |
Generated XmlSerializers source code using modified wham Source Core classes from https://github.com/WarHub/wham/commit/7d6227957b1b13bd84775f83d4d9a64041d7c825
Core classes were modified to all have getters and setters.
This should make writing custom XmlSerialization source code generation easier - to have a basis.
The included code won't work primarily because of ImmutableArray. Immutable collections are not handled correctly by XmlSerializer on deserialization.
Useful links:
- How the source code is generated:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dotnet-script | |
#r "nuget: System.Linq.Async, 4.1.1" | |
#r "nuget: Optional, 4.0.0" | |
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, 0.11.0" | |
#r "./script/bin/netcoreapp3.1/WarHub.GodMode.SourceAnalysis.dll" | |
using WarHub.ArmouryModel.ProjectModel; | |
using WarHub.ArmouryModel.Source; | |
using WarHub.ArmouryModel.Source.BattleScribe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
public record class Person { | |
public required int ID { get; init; } | |
public string FirstName { get; init; } | |
public string LastName { get; init; } | |
} | |
public record class Student : Person { | |
public required double Gpa { get; init; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dotnet-script | |
// Author: Amadeusz Sadowski | |
#r "nuget: morelinq, 3.2.0" | |
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, [0.7.0-beta.3]" | |
using System.Collections.Immutable; | |
using System.Text.RegularExpressions; | |
using MoreLinq; | |
using WarHub.ArmouryModel.Source; | |
using WarHub.ArmouryModel.Source.BattleScribe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install-Module -Name PowerShellForGitHub -Scope CurrentUser | |
# | |
Import-Module PowerShellForGitHub | |
function New-BsdataRepo { | |
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
# Repo description | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] |
# in repo directory
$files = dir * -Include *.cat,*.gst
$datas = $files | % { [xml] (cat $_) }
$roots = @($datas.catalogue, $datas.gameSystem) | % { $_ } | ? {$_}
# show all unique pub names
$roots.publications.publication.name | % { $_ } | select -Unique | sort
NewerOlder