This topic contains 5 replies, has 3 voices, and was last updated by
June 8, 2015 at 12:06 pm #26128
I am new to Powershell and really scripting altogether. By reading around and watching Jeff Snover and Jason Helmick's powershell tutorial video, I was able to get servers to sift through eventlogs and email me errors from the previous day...that was really freaking cool.
Now I want to compress and copy txt files across domains to my webserver and then uncompress them.
I have different clients so their servers...some are 2003, some are 2008, some are 2008R2, some are 2012 and 2012r2.
My question is about approach. Would it work and be better to get these extensions that allow zipping in powershell... http://pscx.codeplex.com/releases/view/98267 and then create a script that logs in via enter-pssession (which is a PIA as I would need to establish ssl certificates with each server correct?)? Or do I need to install the powershell extensions on all of these servers in order for them to be able to zip stuff? Will these extensions even work on powershell v1 and v2? The release notes say that the version 1.2 works for earlier versions of powershell, but when I installed the MSI, when I tried to inquire get-help about cmdlets, I got alot of red text.
I also dont quite get how "extensions" are different from "modules" should I copy them into a modules folder?
Maybe it would be easier to powershell script on v3 and higher servers and try to script a 7zip tool for some of these ancient servers.
June 8, 2015 at 12:21 pm #26129KeymasterTopics: 13Replies: 4872Points: 1,842Rank: Community Hero
You have a lot going on.
First, keep in mind that Remoting (prior to v5) doesn't provide a file copy function. So to physically copy the file, you're going to have to get to a file share.
Also keep in mind that, once you Remote to a machine, by default you can't access non-local resources from that machine. So if you Enter-PSSession to a machine, that machine can't copy anything to a remote file share.
And yes, if you want a server to ZIP something, it's going to have to have the code that knows how. If that's WinZIP, fine. If it's PSCX, fine. But the server can't run code located elsewhere. PSCX does work on v1, if you get the right version. But v1 is really really really old, and nobody's going to be much help getting newer stuff working on it.
"Extensions" isn't a thing. It's a word the PSCX team uses. It's not a technical term. PSCX is distributed as a Snap-In (v1) or a Module (v2+).
You asked about nine questions and I'm not sure if I answered them all, but you're welcome to repeat any I missed.
June 8, 2015 at 12:43 pm #26135
I was terribly wrapped around the axle and you got me straightened out a bunch thank you!
One last thing powershell v5, is that only on 2012r2? I have a few of those servers and I will still try a powershell script on those as it will be great practice.
June 8, 2015 at 1:34 pm #26137KeymasterTopics: 13Replies: 4872Points: 1,842Rank: Community Hero
PowerShell v5 isn't released yet, and the technical preview is, as far as I know, only for 2012R2. It will eventually be made available for older versions of Windows, but we don't know which ones yet.
June 8, 2015 at 11:03 pm #26177ModeratorTopics: 2Replies: 525Points: 24Rank: Member
The April preview of PowerShell v5 was released for down-level versions (Windows 7 SP1/Server 2008 R2 SP1, Windows 8.1/Server 2012 and 2012 R2). The latest v5 preview is only available in the Insider Preview builds of Windows 10.
I believe the PowerShell team officially announced at the PowerShell Summit that above down-level versions will be supported with the final release of v5.
June 9, 2015 at 5:00 am #26193
Thank you very much gentlemen.
So what I should be able to do though is maybe use powershell script to encapsulate command line apps that will do the work like say 7zip and Robocopy. Then I can just run the single Powershell script from task scheduler.
The topic ‘Compress/Copy across domains’ is closed to new replies.