What is this scripting and how it is using .NET 4.5? Is it C# scripting? PowerShell Scripting? VBA Scripting?
I've found this answer in another question and was curious about it. As it's using .NET 4.5, I tried using the same methods in my .NET 4.7 solution and it wasn't available in Intellisense. Also I don't understand how you can call .NET 4.5 in that way from PowerShell and whey it would differ from the methods I get from my SDK?
The below code was submitted by @MDMarra
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
$Compression = [System.IO.Compression.CompressionLevel]::Optimal
$IncludeBaseDirectory = $false
$Source = "C:\Path\To\Source"
$Destination = "C:\CoolPowerShellZipFile.zip"
[System.IO.Compression.ZipFile]::CreateFromDirectory($Source,$Destination,$Compression,$IncludeBaseDirectory)
Does Windows have a built-in ZIP command for the command line?