Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Add-Zip
- {
- param([string]$zipfilename)
- if(-not (test-path($zipfilename)))
- {
- set-content $zipfilename ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
- (dir $zipfilename).IsReadOnly = $false
- }
- $shellApplication = new-object -com shell.application
- $zipPackage = $shellApplication.NameSpace($zipfilename)
- foreach($file in $input)
- {
- $zipPackage.CopyHere($file.FullName)
- }
- }
- cd C:\\logYzm
- $z="$env:TMP\t.zip"
- del $z
- Get-ChildItem C:\\logYzm\\yzmService*|Add-Zip $z
- $ws = New-Object System.Net.WebClient
- $ws.UploadString($url, "PUT", "testdata")
- $ws.Dispose()
- del $z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement