2016-11-14から1日間の記事一覧
# ほげほげ <# ほげほげ #> ネタ元 http://bayashita.com/p/entry/show/36
$wsobj = new-object -comobject wscript.shell $result = $wsobj.popup("PowerShellでメッセージボックスを表示")ネタ元 http://win.just4fun.biz/PowerShell/PowerShell%E3%81%A7%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%83%9C%E3%83%83%E3%82%A…
Get-ChildItemコマンドレットは FileInfoオブジェクト を返します。 FileInfoクラスには 絶対パスからファイル名を取得するためのプロパティ Name がありますのでこれを使用します。 $(Get-ChildItem "C:\Work\HIRO1.mdf").Nameネタ元 http://hiros-dot.net/…
普通にはできないのでbatファイルと組み合わせる。バッチファイル(.bat)記述例 ・example.bat @echo off powershell -ExecutionPolicy Unrestricted -File %0\..\example.ps1 %*スクリプトファイル(.ps1)記述例 ・example.ps1 foreach ($arg in $args) { // …
引数でアップロードするファイル指定するバージョンhogehoge.ps1として保存 foreach ($arg in $args) { [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $filename = $(Get-ChildItem $arg).Name #「検証プロシージャによ…