User Tools

Site Tools


os:windows:powershell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
os:windows:powershell [2011-02-09 17:22] rootos:windows:powershell [2018-12-04 09:16] (current) root
Line 1: Line 1:
 ====== PowerShell ====== ====== PowerShell ======
  
 +===== Basic =====
  
-$env:path +";\\iit-wf02\Archive\Data\Engineering\Private\Software\Windows\Install\Net4\Admin\Tools"+==== Temporary add a directory to the PATH variable ====
  
 +<code>
 +$ENV:PATH += ";C:\Users\Admin\bin"
 +</code>
  
-===== Links =====+==== Parse integer ====
  
-  * [[http://www.magnus.de/tabelle/formatierungsoption-fuer-f.html]]+<code> 
 +PS H:\> $x = Read-Host 
 +
 +PS H:\> [int32]::TryParse($x,[ref]0) 
 +False 
 +PS H:\> $x = Read-Host 
 +
 +PS H:\> [int32]::TryParse($x,[ref]0) 
 +True 
 +</code>
  
 +==== Multidimensionale Arrays ====
  
 +<code>
 +PS C:\> $a = ( "a", "b", "c" ),( "d", "e", "f" )
 +PS C:\> $a += ,( "g", "h", "i" )
 +PS C:\>
 +PS C:\> $a[0]
 +a
 +b
 +c
 +PS C:\> $a[2]
 +g
 +h
 +i
 +PS C:\> $a[0][0]
 +a
 +PS C:\> $a[2][0]
 +g
 +PS C:\>
 +</code>
 +
 +===== Scheduled Tasks =====
 +
 +==== Change Priority ====
 +
 +This will only change the priority setting and keep the other settings. The password of the task user is required.
 +
 +<code>
 +$task = Get-ScheduledTask -TaskName "ThisIsMyTask"
 +$settings = $task.Settings
 +$settings.Priority = 5
 +Set-ScheduledTask -TaskName $task.TaskName -Settings $settings -User $task.Principal.UserId -Password "asdf1234"
 +</code>
os/windows/powershell.1297268575.txt.gz · Last modified: 2014-12-18 20:10 (external edit)