By the way, found that Microsoft official documentation on PowerShell is prohibitively bad, even though v.3.0 is finally made well usable; and Intellisense is quite good. The best book I saw so far is this one: http://www.pavleck.net/powershell-cookbook/
The problem with tar is: you would need some code which unpacks it. I, for example, use a plugin to TotalCommander. If you know, say, a stand-along command-line utility, consider the problem solved. If you have some .NET code, it can be easily loaded by PowerShell and used through Reflection. (I don't mean using cmdlets; of course, such code could also be re-worked into a cmdlet and registered in GAC to make it immediately accessible by PowerShell.)
Solution restored. I'll try to provide some more help…
Please see my last comments.
I suggest you use PowerScript, mostly because it is, well,.. powerful, and, most importantly, much, much easier to develop and debug, with advent of v.3.0, where the Power Shell ISE is million time better than previous, with really working Intellisense (!), in particular.
Then, I would suggest you use 7-zip, as the best compression package I know. Please see:
It support a number of formats, and, importantly, is good enough to work in command line mode.
Now, how you use it via PowerScript? Through the cmdlet with expertly chosen options
. Consider you have your executable (such as compression software executable module) and the list of arguments it requires in the variables
. Then, you script it this way:
$filePath = "some file name here, absolute or relative file name..."
$arglist = "some argument", "some other argument", "some more arguments"
# could be just one string with all arguments, to keep it simple
# now, start it:
Start-Process -NoNewWindow -wait -FilePath $filePath -ArgumentList $arglist
This approach may require some temporary storage for temporary files. First, you can use .NET API to find out the "Special Folder", the one associated with the current user and reserved for temporary storage, etc.
You can see what are the special folders:
In particular you can do:
$filename = [System.IO.Path]::GetTempFileName()
and use one in this way:
[Environment]::GetFolderPath("LocalApplicationData") # per user
and then, under this directory, there is a user's "temp" sub-directory.
Something like that. Not really difficult. Best thing, debugging is good enough.
I think these recommendation will be quite enough to solve the problem.