Better cross platform support
Edit-MyScript will pause if edit is running in background (conext returning less than a second after launching editor) Test-MyModules which loads at stratup now has specific platform lists
This commit is contained in:
parent
7dd40b7b82
commit
8566ea6863
|
@ -71,7 +71,13 @@ foreach( $local:p in $ScriptPaths ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$local:sw = [System.Diagnostics.Stopwatch]::StartNew();
|
||||||
Edit-TextFile $ScriptPaths
|
Edit-TextFile $ScriptPaths
|
||||||
|
$sw.Stop();
|
||||||
|
|
||||||
|
if( $sw.Elapsed.TotalSeconds -lt 1 ) {
|
||||||
|
$null = Read-Host "Waiting before refreshing. Press <Enter> when you're done editing ( don't forget to save ;) )..."
|
||||||
|
}
|
||||||
|
|
||||||
Get-Command Reload-MyScripts -ErrorAction SilentlyContinue |
|
Get-Command Reload-MyScripts -ErrorAction SilentlyContinue |
|
||||||
ForEach-Object { . $_.Definition }
|
ForEach-Object { . $_.Definition }
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
if( -not $global:MyModulesWarning ) {
|
param([switch]$Force)
|
||||||
|
|
||||||
|
$local:currentSys = [SystemName]::_GetValidValues('',$true,$true);
|
||||||
|
|
||||||
|
if( -not $global:MyModulesWarning -or $Force ) {
|
||||||
$global:MyModulesWarning = @()
|
$global:MyModulesWarning = @()
|
||||||
}
|
}
|
||||||
[MyConfig]::GetConfigPaths('mymodules',$false) |
|
[MyConfig]::GetConfigPaths('mymodules',$false) |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
$( Get-Content $_ | ConvertFrom-Json ).Modules
|
$local:modules = $( Get-Content $_ | ConvertFrom-Json );
|
||||||
|
$modules.Always;
|
||||||
|
$currentSys | ForEach-Object { $modules."$_" } | Where-Object { $_}
|
||||||
} | Where-Object {
|
} | Where-Object {
|
||||||
$local:m = $_
|
$local:m = $_
|
||||||
if( $( try {
|
if( $( try {
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
{
|
{
|
||||||
"Modules": [
|
"Always": [
|
||||||
"Microsoft.PowerShell.UnixCompleters",
|
|
||||||
"PowerShellCookbook",
|
"PowerShellCookbook",
|
||||||
"oh-my-posh",
|
"oh-my-posh",
|
||||||
"posh-git"
|
"posh-git",
|
||||||
|
"z"
|
||||||
|
],
|
||||||
|
"Desktop": [
|
||||||
|
],
|
||||||
|
"Unix": [
|
||||||
|
"Microsoft.PowerShell.UnixCompleters"
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue