zoukankan      html  css  js  c++  java
  • PowerShell Pipelines

    PowerShell - Pipelines

    Pipeline
    • A series of commands connected by pipeline operators (|)
    • Output of Preceding command becomes input of next command
    • Objects are sequentially sent across pipeline, one by one
    # Without Pipeline
    Get-Service "Windows Update"
    Stop-Service "Windows Update"
    
    # With Pipeline
    Get-Service "Windows Update"|Start-Service
    
    # Uses of Pipeline
    Get-Service | ft name -AutoSize
    Get-Service | where {$_.DisplayName -like "Windows Update"}
    
    # Use Passthru Parameter
    New-Item .\test.txt
    Rename-Item .\test.txt pest.txt
    
    Rename-Item .\pest.txt test.txt | Get-Item
    Rename-Item .\test.txt pest.txt -PassThru | Get-Item
    
    # Know the type data of Output o a Command and how it is passed down the pipeline
    Get-Service | Get-Member
    
    help stop-service -Parameter *
    

    image-20220105104752588

    相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。
  • 相关阅读:
    rest_framework学习之路
    jQuery操作cookie
    Cookie和Session
    HTTP之Content-Type
    HTTP协议
    Python之random模块
    HTML5(FileRdeader)
    Python之re模块
    LINQ基础 之 LINQ TO SQL (二)
    LINQ基础(一)
  • 原文地址:https://www.cnblogs.com/keepmoving1113/p/15765850.html
Copyright © 2011-2022 走看看