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 Test-ModuleNaming { | |
#We test the naming of a module. | |
#see : https://github.com/PowerShell/PowerShell/issues/17342 | |
# https://github.com/Splaxi/PSNotification/issues/15 | |
param( | |
#Name of module directory to check.The name come from the nuget package ( case sensitive) | |
$ModuleName, | |
$Version, |
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
#from https://github.com/PowerShell/PowerShell/issues/18364#issuecomment-1289401093 | |
$Writer = [System.IO.StreamWriter]::new("$HOME\DemoLog.txt") | |
$Writer.AutoFlush = $true | |
$OriginalOut = [System.Console]::Out | |
try | |
{ | |
[System.Console]::SetOut($Writer) | |
[System.Console]::WriteLine("Hello") | |
} |
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 Get-VariableType { | |
#If a PSVariable is $null, it is impossible to get his type. | |
#One must read the _convertTypes member of ArgumentTypeConverterAttribute class. | |
#Origin : http://poshcode.com/998 | |
param([string]$Name) | |
Write-Debug ("Call : {0}" -F $MyInvocation.InvocationName) | |
get-variable $name | select -expand attributes | ? { | |
$_.gettype().name -eq "ArgumentTypeConverterAttribute" } | % { | |
$_.gettype().invokemember("_convertTypes", "NonPublic,Instance,GetField", $null, $_, @()) | |
} |
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
task Actionlint { | |
# Linting all workflow files only in .\.github\workflows directory | |
if (Get-Command gh.exe) | |
{ | |
$isActionLintExist=(gh extension list|Where-Object {$_ -match 'actionlint'}|Select-Object -first 1) -ne $null | |
if (-not $isActionLintExist) | |
{ Throw "Github Cli: 'actionlint' extension not found. Use : gh extension install cschleiden/gh-actionlint"} | |
$ActionLintErrors=gh actionlint -format '{{json .}}'|ConvertFrom-Json |