Jump to content

tdelgreco

Members
  • Gesamte Inhalte

    3
  • Registriert seit

  • Letzter Besuch

Beiträge erstellt von tdelgreco

  1. function Start-cpSleepProgressBar {
    <#
    .SYNOPSIS             
        This feature is the control of the function Write-Progress Bar simplified.
    
    .DESCRIPTION            
        This feature is the control of the function Write-Progress Bar simplified.
           
    .EXAMPLE   
    
        Start-cpSleepProgressBar -Activity "test" -ProgressFlow Increasingly -TimeIn Seconds -Value 10
             
    .EXAMPLE
        Start-cpSleepProgressBar -Activity "test" -ProgressFlow Decreasing -TimeIn Seconds -Value 10
    
    .EXAMPLE
        Start-cpSleepProgressBar -Activity "test" -ProgressFlow Increasingly -TimeIn Seconds -Value 10 -ReturnCode
    
    .NOTES    
        Create by : T. Del Greco
        Date      : 03.03.2018
    
    #>
    
    [CmdletBinding()]
    [OutputType()]
    
    PARAM (
        [parameter(Mandatory=$false)][System.String]$Activity = "Please wait.",
        [parameter(Mandatory=$false)][ValidateSet('Increasingly','Decreasing')][System.String]$ProgressFlow = 'Increasingly',
        [parameter(Mandatory=$false)][ValidateSet('Hours','Minutes','Seconds')][System.String]$TimeIn = 'Seconds',
        [parameter(Mandatory=$true)][System.Int32]$Value,    
        [parameter(Mandatory=$false)][System.Boolean]$ReturnCode
    )
    
    BEGIN {
        switch ($TimeIn) {
            'Seconds' {
                $SleepSeconds = $Value
            }
        
            'Minutes' {
                $SleepSeconds = $Value * 60
            } 
            'Hours' {
                $SleepSeconds = $Value * 60 * 60
            }   
        }
    }
    
    PROCESS {
        switch ($ProgressFlow) {
                
            'Increasingly' {
                for($Count=0; $Count -lt $SleepSeconds; $Count++) {
                    Write-Progress -Activity $Activity -Status "Sleeping" -SecondsRemaining $Count -PercentComplete ($Count/$SleepSeconds*100)
                    Start-Sleep -Seconds 1
                }
            }
    
            'Decreasing' {
                for($Count=$SleepSeconds; $Count -gt 0; $Count--) {            
                    Write-Progress -Activity $Activity -Status "Sleeping" -SecondsRemaining $Count -PercentComplete ($Count/$SleepSeconds*100)
                    Start-Sleep -Seconds 1
                }
            }       
        }
    }
    
    END {
        if ($ReturnCode) {
            return $true
        }
    }
    }

     

  2. Hallo 'Board Veteran',

     

    ich bevorzuge ebenfalls die Bücher von 'Microsoft Press', leider werde hier jedoch nur noch die Examen 70-410, 70-417 und 70-413 angeboten :-( ein komplettes Band in deutscher Sprache ist anscheint nicht mehr erhältlich, aus diesen Grund suche ich eine kompetenten Ersatz!

     

    Mit freundlichen Grüßen

    tdelgreco

×
×
  • Neu erstellen...