Come to my brother in the console!
- Admin Dolgoruky.
dir
ls
ls Alias:\
Get-Process #
Remove-Item # -
Get-Help # -
Set-Alias #
New-Item # ( , , )
Get-PSDrive
Name Used (GB) Free (GB) Provider Root ---- --------- --------- -------- ---- Alias Alias C 16.56 63.44 FileSystem C:\ cert Certificate \ D .11 53.92 FileSystem D:\ Env Environment Function Function HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable WSMan WSMan
Set-Location HKLM: # , , cd HKLM:
SKC VC Name Property --- -- ---- -------- 2 0 BCD00000000 {} 4 0 HARDWARE {} 1 0 SAM {} Get-ChildItem : Requested registry access is not allowed. At line:1 char:3 + ls <<<< -force + CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACHINE\SECURITY:St ring) [Get-ChildItem], SecurityException + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.Power Shell.Commands.GetChildItemCommand 35 0 SOFTWARE {} 8 0 SYSTEM {}
Get-Help # , help
get-help New-Item -Examples
get-help files
PS C:\> get-help Files Name Category Synopsis ---- -------- -------- FileSystem Provider Provides access to files and dire... about_profiles HelpFile Describes how to create and use a...
get-help Registry
, ,
PS C:\> ls -filter "*.bat" | Get-Content REM Dummy file for NTVDM
Get-Help Registry | Set-Content reg.txt
ps | ls
PS C:\> ps wordpad | ls Directory: C:\Program Files\Windows NT\Accessories Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/28/2010 9:57 PM 4247040 wordpad.exe
ps wordpad | Get-Member
PS C:\> notepad PS C:\> ps notepad Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 70 4 1148 5376 56 0.30 3900 notepad PS C:\> ps notepad | get-member -type method TypeName: System.Diagnostics.Process Name MemberType Definition ---- ---------- ---------- BeginErrorReadLine Method System.Void BeginErrorReadLine() BeginOutputReadLine Method System.Void BeginOutputReadLine() CancelErrorRead Method System.Void CancelErrorRead() CancelOutputRead Method System.Void CancelOutputRead() Close Method System.Void Close() CloseMainWindow Method bool CloseMainWindow() CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObj... Dispose Method System.Void Dispose() Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetLifetimeService Method System.Object GetLifetimeService() GetType Method type GetType() InitializeLifetimeService Method System.Object InitializeLifetimeService() Kill Method System.Void Kill() Refresh Method System.Void Refresh() Start Method bool Start() ToString Method string ToString() WaitForExit Method bool WaitForExit(int milliseconds), Syst... WaitForInputIdle Method bool WaitForInputIdle(int milliseconds),...
(ps notepad).WaitForExit()
(ps notepad).StartTime | Get-Member
. , . PS? , .
$processList = ps
PS C:\> [DateTime]$x = "febbrrr" Cannot convert value "febbrrr" to type "System.DateTime". Error: "The string was not recognized as a valid DateTime. There is a unknown word starting at index 0." At line:1 char:13 + [DateTime]$x <<<< = "febbrrr" + CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException + FullyQualifiedErrorId : RuntimeException PS C:\> [DateTime]$x = "02/14/11" PS C:\> $x Monday, February 14, 2011 12:00:00 AM
$x = new-object System.Object
C:\> $client = New-Object System.Net.WebClient C:\> $client.DownloadString("http://google.com")
set-executionpolicy remotesigned
New-Item -type file $PROFILE
vim $PROFILE
notepad $PROFILE
$webClient = New-Object System.Net.WebClient $cred = New-Object System.Net.NetworkCredential("login", "Pass") $webClient.Proxy = New-Object System.Net.WebProxy("www.proxy.adrress", $true, $null, $cred)
Source: https://habr.com/ru/post/113913/
All Articles