Skip to content

Instantly share code, notes, and snippets.

View Molochnikov's full-sized avatar
🏠
Working from home

Molochnikov

🏠
Working from home
View GitHub Profile
@Molochnikov
Molochnikov / js.ps1
Last active February 14, 2022 12:39
ps.js
function arguments() {
$dict = iex('gv PSBoundParameters -scope 1 -ValueOnly');
$dict = iex('@($dict[$dict.keys])');
$pars = iex('(gv myinvocation -Scope 1 -ValueOnly).MyCommand.parameters');
$en = $pars.GetEnumerator();
$arr = iex('New-Object System.Object[] 0');
$j = 0;
while ($en.MoveNext()) {
iex('sv -name $en.Current.Value.Name -value $dict[$j] -scope 1');
$arr += $dict[$j];