Skip to content

Duplicate Files Using Standard Input #13

Description

@mattcargile

File generated in $env:Temp isn't opened by VS Code. code.exe still generates its own file when doing 'hello world' | Invoke-VSCode -

Maybe $inputobjects can be piped directly in somehow? I'd like to avoid the file generate in $env:Temp. Below is the code section I'm talking about.

$pipeTempPath = (join-path $env:TEMP ("pscode-stdin-{0}.txt" -f [System.GUID]::NewGuid().ToString()))
Write-Verbose "Writing out piped input to file $pipeTempPath"
$inputObjects | out-file $pipeTempPath -Encoding ascii
Start-Process -FilePath $codePath -ArgumentList $codeArgs -RedirectStandardInput $pipeTempPath

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions