Closed mastersign closed 8 years ago
Another hinderance is the use of Invoke-WebRequest
wich was introduced with PS3
The last hinderance is the different behavior of foreach
in PS2
Replaced operator -in
with -contains
in 9213a0d06304073fe50a003d47bf396538ed1618 and 2e928d047f864d78278b760e9d4711edb0a5e97f
Rewrote download from Invoke-WebRequest
to direct use of System.Net.WebClient
in 058981ffca74bd429cab701373014157d2735422
Before PowerShell 3, the for-each loop goes through one iteration, if the collection is $null
. Since PowerShell 3, no iteration is executed, if the collection is $null
. To avoid wrapping the for-each block in another code block, the following check is introduced in almost all for-each loops.
foreach ($e in $elements)
{
if (!$e) { continue } # check if the iterated element is $null, 0 or empty
...
}
Sanitized foreach
loops in 12417d49c26bcadc9d6c051e775f29d3bf2e81fc
Error during Setup: Did not find an overload with 3 arguments for Combine
.
The .NET Framework 2.0 under a fresh Windows 7 does not support System.IO.Path.Combine()
with more than two arguments.
Resolved by b22a220fe1edd891fb11faadd0a3bfea4619e5b7
One hinderance is the use of the
-in
operator, which was introduced with PS3