gcm | ? {$_.Source -eq "Conda"}(gcm mkdir).Definition$function:mkdir${function:mkdir}
[string]::IsNullOrWhiteSpace($line)gcm | ? {$_.Source -eq "Conda"}(gcm mkdir).Definition$function:mkdir${function:mkdir}[string]::IsNullOrWhiteSpace($line)# path to the destination folder
$path = 'D:\artyu\OneDrive\Software\PowerShell\'
# $data это массив строк и к его элементам можно обращаться по индексу
$data = Get-Content -Path ($path + 'aliases.txt')
$i = 0
foreach ($line in $data)
{
if (!($line -like '*->*') -and ![string]::IsNullOrWhiteSpace($line))
{
$data[$i] = (Get-Command $line).name + ' -> ' + (Get-Command $line).definition
}
$i ++
}
echo $data