Script

There are 2 entries for the tag Script

PowerShell and untrusted domains

I have a few PowerShell scripts that execute various automation tasks on our build machine, like sanity test of the latest build for example. The common scenario is to revert-VMWare-snapshot, copy latest build to target machine, execute whatever needs to be executed. This worked fine until I was asked to do the same tests on different domain, which is not in trust with domain of our build machine. At first glance, I thought that –Credentials parameter in PowerShell will do the trick, but it turned out it doesn’t work at all for functions like Copy-Item or Set-Content. I thought...

Sending E-mail From PowerShell v1.0

While in PowerShell 2 there will be a “Send-Mail” cmdlet (as I heard), I needed something for current version. Here is the self-explaining PowerShell script for sending mails with optional attachments and multiple recipients. Remember to change the hard-coded “mail.server.com” to your own mail server, otherwise nothing will work :). ############################################################## # Send e-mail with optional attachments # function SendEmail { param( $From, $To, $Subject, $Body, ...