troubleshooting Question


Avatar of AXISHK
AXISHK asked on
1 Comment1 Solution183 ViewsLast Modified:
I can't use the "" in my powershell .NET Framework 4.7 has been installed. Any idea ?


if(Test-path $$ZipLog ) {Remove-item $$ZipLog}
Add-Type -assembly "" [io.compression.zipfile]::CreateFromDirectory($ZipSourceDir, $ZipLog = "C:\MyBackup\")

PS C:\Windows\system32> C:\MyBackup\mytest.ps1
Add-Type : A positional parameter cannot be found that accepts argument '[io.compression.zipfile]::CreateFromDirectory'.
At C:\MyBackup\mytest.ps1:18 char:1
+ Add-Type -assembly "" [io.compression.zipfile]:: ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Add-Type], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.AddTypeCommand
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros