Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
windows:powershell [2021/10/12 09:26] – admin | windows:powershell [2022/09/21 07:22] (current) – admin | ||
---|---|---|---|
Line 3: | Line 3: | ||
< | < | ||
Enter-PSSession –ComputerName host [-Credential username] | Enter-PSSession –ComputerName host [-Credential username] | ||
+ | Enter-PSSession -ComputerName main-1700 -Credential domain\user | ||
</ | </ | ||
* example < | * example < | ||
+ | |||
+ | <code powrshell> | ||
+ | # список файлов - list files powershell | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | $file_name = ($_ | split-path -leaf) | ||
+ | $file_name_withoutextension = [System.IO.Path]:: | ||
+ | $file_destination = $destination + ' | ||
+ | $file_dest = ($_ | split-path -parent) -replace $source_regex, | ||
+ | |||
+ | #if (-not (test-path $file_dest)){mkdir $file_dest} | ||
+ | # | ||
+ | # | ||
+ | $_ | ||
+ | # | ||
+ | #| Select-Object -Property Length | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | # put files in list | ||
+ | Get-ChildItem -Recurse -Include *.pdf| Format-Table name -hidetableheaders | Out-File 'pdf list.txt' | ||
+ | </ | ||