wsl service cron status | Select-String Active { -replace '.*since (.*)', 'running since $1'}
# WSL Cron
do
{
Get-CronStatus
if ((Get-CronStatus) -match 'dead' ){
Write-Host "Cron is down"
Install-Cron
Start-Sleep -Seconds 1
}
if ((Get-CronStatus) -match 'running' ){
Write-Host "Cron is up"
Start-Sleep -Seconds 1
curl -X GET -k "https://api.telegram.org/$UbuntuBot$SendMessage$CompName%0ACRON%0A$(Get-CronStatus)"
}
}
Until ( (Get-CronStatus ) -match 'running' )
}
Аctive: active (running) since Tue 2023-04-18 16:20:03 MSK; 59min agoдо
running since Tue 2023-04-18 16:20:03
mv -fv "$( dirname "$WhatFolder" )" "$( dirname "$WhatRenameFolder" )"; if [ $? -eq 0 ]; then (FolderWork=$( echo "true")) ; fi
что-то подобное