jwetoszka

Powershell Lab8 commands

Dec 6th, 2021 (edited)
628
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set-ExecutionPolicy RemoteSigned (trzeba mieć prawa administratora)
  2.  
  3. Get-Date
  4. Get-ComputerInfo
  5. Get-NetAdapterHardwareInfo
  6. New-LocalUser
  7. Remove-LocalUser
  8. Get-PhysicalDisk
  9. Get-Partition
  10.  
  11.  
  12. $Action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-file "d:\updateLog.ps1"'
  13. $Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 1)
  14. Register-ScheduledTask Task01 -Action $Action -Trigger $Trigger
RAW Paste Data