guitarrapc / powershellutil Goto Github PK
View Code? Open in Web Editor NEWPowerShell Common Utilities
License: Other
PowerShell Common Utilities
License: Other
From Mr. Mutaguchi.
これsourceにサブディレクトリがあると圧縮に失敗するでござるよ。ZipFile.CreateFromDirectoryを使えばいいのかなあ。
From Mr. Mutaguchi
forceパラメータの処理がなんかおかしくないですか? -force指定してもターゲットを削除するか確認プロンプトが出てしまう…。
逆に-forceなしでターゲット名重複の場合で削除処理をユーザーがキャンセルすると、圧縮処理でエラーになっちゃう。ここは削除の確認じゃなくて、圧縮ファイルを上書きするかどうかの確認が出てほしいところです。もちろんキャンセルならエラーなしで終了。
疑似コードならこんな感じ。if(重複){if(force){del;zip;}else{if(prompt){del;zip;}else{exit}}}else{zip;}
From Mr. Mutaguchi
あと$file.Mode -like "d*"は$file.PSIsContainerの方がいいかも?
From Mr. Mutaguchi
あと-destinationに相対パスを食わせると.NETのカレントディレクトリにzipが生成されますね。ここはPSドライブのカレントに作られて欲しいとおもいます。
What do you think about disabling timeout by parameters? Maybe passing '0' as timeout?
I find out Language Pack for Windows Server 2016.
http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/09/lp_9a666295ebc1052c4c5ffbfa18368dfddebcd69a.cab
So I hope support Windows Server 2016 environment.
Get-DirectoryVolume C:\DevKit 1KB
引数としては設定されているが、内部ロジックは「1MB」のハードコーディングになっています。
From Mr. Mutaguchi
ここからは要望に近いですが、-destinationはフォルダ名のみ指定すればあとは-sourceからよしなにファイル名を生成してくれると嬉しいです。-destination . でカレントフォルダに生成とかできますし。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.