Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # Aufzeichnung der PowerShell-Sitzung
  2. Start-Transcript -Path $env:USERPROFILE\PowerShellTranscript_2201.txt -Append
  3.  
  4. # Alias-Namen
  5. cd hkcu:
  6.  
  7. Set-Location hkcu:
  8.  
  9. Set-Location -Path hkcu:
  10.  
  11. # Abfrage von Befehlsnamen per Get-Command und Get-Module
  12. get-command -Name changelocation
  13.  
  14. get-command *group* | out-gridview
  15.  
  16. Get-Module -ListAvailable *group*
  17.  
  18. # Rekursive Aufrufe
  19.  
  20. # Ohne Aliase
  21. Get-ChildItem C:\Windows\*.log -Recurse -ErrorAction Ignore |
  22. Select-String "2020-01-21"
  23.  
  24. # Mit Aliase
  25. dir C:\Windows\*.log -r -E Ignore | sls "2020-01-21"
  26.  
  27. $Gestern = (Get-Date).AddDays(-1).ToString("d")
  28.  
  29. dir C:\Windows\*.log -r -E Ignore | Select-String "$Gestern.*Error" -EA Ignore
  30.  
  31. dir C:\Windows\Installer\1a93a7e.msi | Select *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement