GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/JimMartinson/CST1861/Resources/Week/14/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/CST1861/Resources/Week/14/notes.txt
$array = 1..10
foreach ($a in $array) {Write-output $a}
foreach ($a in $array) {
	Write-output $a
}

$sum = 0
foreach ($a in $array) {
	Write-output $a
	$sum = $sum + $a
}
Write-Output "The sum of `$array is $sum."

Get-ChildItem | ForEach-Object {
	$_.name
	$_.CreationTime
}

Get-ChildItem -Path ~\Documents\CST1861\Week\14 | ForEach-Object {
	Write-Output "$($_.name) was created on $($_.CreationTime)"
}

$array | ForEach-Object {
	Write-Output $_
}

$n=1
While ($n -le 10){Write-Output $n; $n++ }

$n=1
While ($n -le 10){
	Write-Output $n
	$n++
}

$date = get-date
do {
	Write-Output "Checking if the month is December"
	$date = $date.AddMonths(1)
} while ($date.Month -ne 12 )

$date = get-date
$date = $date.AddMonths(1)
$date
do {
		Write-Output "Checking if the month is December"
$date = $date.AddMonths(1)
} while ($date.Month -ne 12 )

$n=1
do {
	Write-Output $n; $n++
} while ($n -le 10)

$items = Get-ChildItem -Path ~\Documents\CST1861\Week\13
foreach ($i in $items){Write-Output "The character length of $i is "($i).Length}

start-process notepad
$Process = "notepad"
do {
Write-Host "$Process is open"
} while ((get-process).name -contains "notepad")

The Big Book of PowerShell Error Handling
get-help about_automatic_variables > about_automatic_variables.txt

Get-Service -Name Foo,BITS,Nobody,WinRM -ErrorAction Continue
Get-Service -Name Foo,BITS,Nobody,WinRM -ErrorAction Stop
Get-Service -Name BITS,Foo,Nobody,WinRM -ErrorAction Stop
Get-Service -Name BITS,Foo,Nobody,WinRM -ErrorAction SilentlyContinue

$computer = 'Srv01'
Write-Verbose "Connecting to $computer"
$session = New-PSSession -ComputerName $computer -ErrorAction Stop

$computer = 'DESKTOP-46AVB2C'
$computers = 'localhost','Srv01','ooga'

foreach ($Computer in $computers) {
Write-Verbose "Connecting to $computer"
$session = New-PSSession -ComputerName $Computer -ErrorAction Stop
}

$session = New-PSSession -ComputerName $computers -ErrorVariable +a

try { blahfoo }
catch { Write-Warning "Warning: An error occurred." }

$a = ''
try {
	$session = New-PSSession -ComputerName $computer -ErrorVariable +a
}
catch { Write-Warning "Warning: An error occurred."; Write-Output $a }

$cmderrors = ''
$computers | ForEach-Object {
	try {
		Write-Output $_
		$session = New-PSSession -ComputerName $_ -ErrorAction SilentlyContinue -ErrorVariable +cmderrors
	}
	catch { Write-Warning "Warning: An error occurred, look at `$cmderrors for a list."; }
}


try {
		Write-Output $_
		$session = New-PSSession -ComputerName $_ -ErrorAction SilentlyContinue -ErrorVariable +cmderrors
	}
catch { Write-Warning "Warning: An error occurred, look at `$cmderrors for a list."; }
	
$cmderrors = ''
$session = New-PSSession -ComputerName $computers -ErrorAction SilentlyContinue -ErrorVariable +cmderrors
if ( $cmderrors -ne '' )
{
    Write-Warning "Warning: An error occurred, look at `$cmderrors for a list.";
}
try { $session = New-PSSession -ComputerName $computer }
catch { Write-Warning "Warning: An error occurred." }

Function Get-PCUpTime {
	param (
	[string[]]$ComputerName = 'localhost'
	)
	try {
	foreach ($computer in $computerName) {
		If ($computer -eq "localhost") {
				Get-Uptime
		}
		Else { Invoke-command -ComputerName $computer -ScriptBlock { Get-Uptime } -ErrorAction Stop}
		}
	}
	catch {
		Write-Error "Cannot connect To $computer"
	}
}

Anon7 - 2022
AnonSec Team