Invoke-WebRequest does not save all Cookies in SessionVariable

[UPDATE 2014-04-08] Thanks to Meir I updated the post as the code was missing the definition for the regular expression. Now I corrected that, so the code should work now. In addition, I found out that the apple web server is not serving ‘Set-Cookie’ header according to RFC so I changed the example from apple.com […]

Search-OSCEXOEmailMessage does not return (S/MIME) signed messages from folder

I recently had the need to automatically retrieve and process emails. As I am using Office365 what could have been closer than trying to retrieve the emails via PowerShell and EWS. What I was not aware of is that the supplied Cmdlets that come with the “MSOnlineExtended” module only really deal with account and administration. […]

Communication with Apple iTunes Store and WebSite

Recently I had the task to automate a few things regarding AppleIDs. One of things was to create, change and verify AppleIDs. Having no tools (apart from Apples inofficial buggy AppleScript screen-click-automation scripts) I had a look at the HTTP communication between iTunes/the web client and the iTunes Store and AppleID servers. The login to […]

Creating a WebClient Request from an HTTP payload

The other day I was using Fiddler to examine some web traffic to automate some tasks. I then stumbled upon a cool Fiddler extension called Request to Code (by Chad Sowald), which takes any HTTP(s) request and converts it to C# code using the System.Net.WebRequest and System.Net.WebResponse classes. Unfortunately, the extension does not support PowerShell. […]

Schedule PSScheduledJob with a RepetitionInterval of less than 1 minute

When trying to define a RepitionInterval on a schedule job of less than one minute you receive the following error message: However, there is a workaround on this: you define additional triggers that fire every minute and have them start eg. every 15 seconds: There is a maximum of 48 triggers you can define for […]

PSScheduledJob only works with positional parameters in ArgumentList

When using scheduled jobs in PowerShell v3 you can pass parameters to the scheduled job via the “ArgumentList” parameter. However, you can only pass values via its position (instead via its name) as the parameter expects an array of objects: So it is not possible to run any of your scripts as “scheduled jobs” when […]

[Array] becomes [ArrayList] when imported via Import-CliXml

Serialising and Deserialising data structures is pretty easy when using Export-CliXml/Import-CliXml. However, there are some gotchas. In addition to the already described bug when using [ordered] hashtable in PowerShell v3 with Import-CliXml there is another error when importing [Array] with Import-CliXml: an [Array] becomes an [ArrayList]. The following code shows the problem: Again, this error seems […]