Это старая версия документа!
# Отключить Set-ExecutionPolicy RemoteSigned # Включить обратно Set-ExecutionPolicy Restricted
# -Property либо ExpandProperty (раскрывает содержимое) # "Format-Wide" - для вывода значения get-computerinfo | Select-Object -ExpandProperty <ColumnName> | Format-Wide
Get-Service -Name win* | Format-Table -AutoSize -AutoSize get-computerinfo -Property "CsProcessors" | Out-File -Width 2000 -FilePath out.txt
# Create a zip file with the contents of C:\Stuff\ Compress-Archive -Path C:\Stuff -DestinationPath archive.zip # Add more files to the zip file # (Existing files in the zip file with the same name are replaced) Compress-Archive -Path C:\OtherStuff\*.txt -Update -DestinationPath archive.zip # Extract the zip file to C:\Destination\ Expand-Archive -Path archive.zip -DestinationPath C:\Destination # Use the pipeline to archive a directory Get-ChildItem -Path C:\LogFiles | Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip # Архивирование с исключением некоторых файлов/папок Get-ChildItem -Path "mypath" -Exclude @("backups", "logs") | Compress-Archive -DestinationPath mypath\\backups\\archive.zip