Thursday, September 29, 2022

PowerShell Working Script

 Here's my latest PowerShell script to appear to be working...

$Adverbs = @();$Actions = @();$Apps = @();$Objects = @()
$Adverbs = @('quickly','painstakingly','randomly','slowly','literally','boldly','bravely','brightly',
    'cheerfully','deftly','devotedly','eagerly','elegantly','faithfully','gleefully','gracefully',
    'happily','honestly','innocently','kindly','merrily','obediently','perfectly','politely','powerfully',
    'safely','victoriously','warmly','vivaciously','achingly','angrily','annoyingly','anxiously','badly',
    'boastfully','dejectedly','enviously','foolishly','hopelessly','irritably','jealously','joylessly',
    'lazily','miserably','morosely','obnoxiously','painfully','poorly','rudely','sadly','selfishly','terribly',
    'unhappily','wearily','finally','frequently','generally','nightly','normally','occasionally','regularly',
    'still','briskly','casually','expeditiously','fleetingly','gradually','haltingly','hastily','hurriedly',
    'immediately','instantly','languidly','lazily','leisurely','promptly','quickly','rapidly','slowly','speedily',
    'swiftly','tediously','audibly','deafeningly','ear-splittingly','emphatically','faintly','inaudibly','loudly',
    'noiselessly','noisily','quietly','resonantly','resoundingly','shrilly','silently','softly','soundlessly',
    'thunderously','uproariously','vociferously','weakly','accidentally','awkwardly','blindly','coyly','crazily',
    'cruelly','defiantly','deliberately','doubtfully','dramatically','dutifully','enormously','excitedly','hungrily',
    'madly','mortally','mysteriously','nervously','seriously','shakily','restlessly','solemnly','sternly',
    'unexpectedly','wildly')
$Actions = @('compacting','extracting','hacking','defragging','extending','requesting','updating','upgrading',
    'packaging','researching','preparing','disabling','searching','calculating','managing','formatting','deploying',
    'deleting','restoring','correlating','patching')
$Apps = @('Net Neutrality','Big Data','Data Mining','Actionable Analytics','Artificial Intelligence (AI)',
    'Machine Learning','Personalization','Voice Recognition','Chatbots','Augmented Reality (AR)','Virtual Reality (VR)',
    'Robotics','Smart Industry 4.0','Internet Of Things (IoT)','Quantum Computing','Blockchain','Technological Unemployment',
    'Multi-Factor Authentication','Everything-as-a-Service','PowerBI','Artificial Inteligence')
$Objects = @('database','directories','servers','websites','folders','email','users','phone numbers','hard drives',
    'floppy disks','IP Addresses','software','firmware','memory','firewall rules','routing tables','fiber optics','NIC cards',
    'CAT5 cables','spreadsheets')
function Randomize-List
{
   Param(
     [array]$InputList
   )
   return $InputList | Get-Random -Count 1
}
function Build-Loop1 {
    $1 = Randomize-List -InputList $Actions
    $2 = Randomize-List -InputList $Apps
    $1 = $1.substring(0,1).toupper()+$1.substring(1).tolower()
    Write-Output "$1 $2..."
}
function Build-Loop2 {
    $1 = Randomize-List -InputList $Adverbs
    $2 = Randomize-List -InputList $Actions
    $3 = Randomize-List -InputList $Apps
    $4 = Randomize-List -InputList $Objects
    $1 = $1.substring(0,1).toupper()+$1.substring(1).tolower()
    Write-Output "$1 $2 $4..."
}
Clear-Host
while (1) {  
$R = (Get-Random 100)
$R2 = (Get-Random 100)
$Activity = (Build-Loop1)
    for($B = 1
        $B -le $R
        $B++) {
            $Activity2 = (Build-Loop2)
            $Stat = (($B/$R) * 100).ToString("#")
            $InnerLoop = @{
                ID = 1
                Activity = $Activity
                Status = "$Stat% Complete"
                PercentComplete = $B/$R * 100
                }
            Write-Progress @InnerLoop
            for($A = 1
            $A -le $R2
            $A++ ) {
            $Stat2 = (($A/$R2) * 100).ToString("#")
            $OuterLoop = @{
            ID = 2
            Activity = $Activity2
            Status = "$Stat2% Complete:"
            PercentComplete = $A/$R2 * 100
            }
            Write-Progress @OuterLoop
            Start-Sleep -Milliseconds (Get-Random 100)
            }
    }
}