2019-09-01から1ヶ月間の記事一覧
#get_dir.ps1 $FilePath = "C:\Users\Admin\cred.sec"$Username = "Admin" $result = Test-Path $FilePath if(!($result)){ $msgBoxInput = [System.Windows.MessageBox]::Show('[.sec]ファイルが見当たりません。credential.ps1を実行しますか?いいえを選…
$a = [Math]::Round($b/$c*100, 2, [MidpointRounding]::AwayFromZero);"空き容量" + [string]$a + "%"
#makeCredential.ps1 $FilePath = "C:\Users\Admin\cred.sec"$Credential = Get-Credential$Credential.Password | ConvertFrom-SecureString | Set-Content $FilePath #get_dir.ps1 $FilePath = "C:\Users\Admin\cred.sec"$Username = "Admin" #.secファイ…
$arr_str.GetType()if ($arr_str.gettype().name -eq "Int64"){Write-Host "OK"}else{Write-Host "NG"}
#閾値$shiki_chi = 90#ドライブ全体の容量カンマなしバイトで記載$max_map = 2948501864448 $arr_str = cmd /c dir \\fsv01\sv01 | findstr "バイトの空き領域"$arr_str = $arr_str.Split(" ")$arr_str = $arr_str[17]$arr_str = $arr_str.replace(",","")$a…
Set-ExecutionPolicy Bypass なにもブロックされなくなるのでセキュリティは最弱になります。 自己責任で。
$list = @("ACDaemon","AdobeActiveFile","AdobeARMservice","AdobeFlashPlaye","AeLookupSvc","ALG","AppIDSvc","Appinfo","AppleMobileDe","AppMgmt")Get-Service | where-object { $_.name -in $list }
if (@("りんご", "いちご", "トマト") -contains "トマト") { Write-Output "赤" }else{ Write-Output "ちがいまんな" }