none
How to code this powershell? RRS feed

  • Question

  • I would like to know on how to inserting content from D:\sample.txt file, which contain only a single line "bus"

    $txt = "I go to school by " << adding file content here

    Does anyone have any suggestions?
    Thanks in advance for any suggestions


    Thanks in advance for any suggestions

    Monday, March 12, 2018 4:21 PM

Answers

  • $filecontent = Get-Content -Path d:\sample.txt
    
    $txt = "I go to school by $filecontent"
    
    Write-Output $txt
    

    • Marked as answer by oemMicrosoft Monday, March 12, 2018 9:13 PM
    Monday, March 12, 2018 4:30 PM

All replies