openzfsonwindows / ZFSin

OpenZFS on Windows port
https://openzfsonwindows.org
1.2k stars 68 forks source link

OpenZFS: PowerShell pipes and redirect #165

Open lundman opened 4 years ago

lundman commented 4 years ago

So it appears that PowerShell likes to translate pipes and redirects which will not play nice with ZFS. There are no end of Questions and various solutions available when searching.

So with regards to PowerShell, should we:

The last one is probably the nicest, but being a novice in PowerShell, I don't know what that would actually look like.

Common ZFS usage includes (The .exe part in zfs.exe indicates Windows)

1 zfs.exe send .. | zfs.exe recv .. 2 zfs.exe send .. | ssh host .. 3 .. | ssh windows zfs.exe recv .. 4 zfs.exe send .. > file.bin 5 zfs.exe recv .. < file.bin

nazar554 commented 4 years ago

Possible solution is to use PowerShell Core (6.x), see this PR

Although it still requires a workaround

lundman commented 4 years ago

Ah interesting. Obviously with ZFS the trick to store pipes as files is completely out of the question, since they are gigs, tera and peta, bytes in size so we do need cmd | cmd. I did try Use-RawPipeline in my PS but was told by Windows that I wasn't allowed to just import it. So if we figured it out, details are needed for wiki.