powershell 来自https://www.reddit.com/r/PowerShell/comments/t00il/oldschool_style_indeterminate_progre

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 来自https://www.reddit.com/r/PowerShell/comments/t00il/oldschool_style_indeterminate_progre相关的知识,希望对你有一定的参考价值。

function BlastFromThePast(){
    if(!$tickcounter){ Set-Variable -Name "tickcounter" -Scope global -Value 0 -Force -Option AllScope }
    if(!$tickoption){ Set-Variable -Name "tickoption" -Scope global -Value 0 -Force -Option AllScope }
    $chance = Get-Random -Minimum 1 -Maximum 10
    if($chance -eq 5){ if($tickoption -eq 1){$tickoption = 0}else{$tickoption = 1} }
    switch($tickoption){
        0 {
            switch($tickcounter){
                0 { Write-Host "`r|" -NoNewline }
                1 { Write-Host "`r/" -NoNewline }
                2 { Write-Host "`r-" -NoNewline }
                3 { Write-Host "`r\" -NoNewline }
            }
            break;
        }
        1 {
            switch($tickcounter){
                0 { Write-Host "`r|" -NoNewline }
                1 { Write-Host "`r\" -NoNewline }
                2 { Write-Host "`r-" -NoNewline }
                3 { Write-Host "`r/" -NoNewline }
            }
            break;
        }
    }
    if($tickcounter -eq 3){ $tickcounter = 0 }
    else{ $tickcounter++ }
}

以上是关于powershell 来自https://www.reddit.com/r/PowerShell/comments/t00il/oldschool_style_indeterminate_progre的主要内容,如果未能解决你的问题,请参考以下文章

[转][PowerShell]ps执行重启IIS

powershell入门教程-v0.3版

powershell入门

PowerShell DSC学习资料

powershell PowerShell:来自InnerException的错误消息

powershell 来自现有Azure PowerShell会话的AccessToken(Bearer)