This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gwmi -Namespace root\wmi WmiMonitorID | %{ | |
| New-Object PSObject -Property @{ | |
| ManufacturerName = -join ($_.ManufacturerName | %{[char]$_}) | |
| ProductCodeID = -join ($_.ProductCodeID | %{[char]$_}) | |
| SerialNumberID = -join ($_.SerialNumberID | %{[char]$_}) | |
| UserFriendlyName = -join ($_.UserFriendlyName | %{[char]$_}) | |
| WeekOfManufacture = $_.WeekOfManufacture | |
| YearOfManufacture = $_.YearOfManufacture | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sbt._ | |
| import Keys._ | |
| object TestBuild extends Build { | |
| lazy val root: Project = Project("root", file("."), aggregate = nonRoots) | |
| lazy val nonRoots = projects.filter(_ != root).map(p => LocalProject(p.id)) | |
| lazy val sub1 = consoleProject("sub1", file("sub1")) | |
| lazy val sub2 = webProject("sub2", file("sub2")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| クリップボート内の画像をファイルに出力します。 | |
| #> | |
| Function cap | |
| { | |
| powershell -sta -command { | |
| Add-Type -AssemblyName System.Windows.Forms | |
| $cb = [Windows.Forms.Clipboard] | |
| $img = $cb::GetImage() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| ソフトウェアのバージョン情報を収集する | |
| #> | |
| $ps1_file = &{$myInvocation.ScriptName} | |
| $base_dir = Split-Path (Split-Path $ps1_file) | |
| $log_dir = "$base_dir\log" | |
| $log_file = "$log_dir\$((Split-Path -Leaf $ps1_file).Replace(".ps1",".log"))" | |
| if (-not (Test-Path "$log_dir")) {New-Item "$log_dir" -Force -ItemType Directory} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $config = @" | |
| "COMPUTER","IPAddress","Subnetmask","Gateway" | |
| "ORANGE","192.168.0.6","255.255.255.0","192.168.0.1" | |
| "BROWN", "192.168.0.7","255.255.255.0","192.168.0.1" | |
| "@ | ConvertFrom-Csv | ?{$_.COMPUTER -eq $Env:COMPUTERNAME} | |
| gwmi Win32_NetworkAdapterConfiguration | ?{$_.IPEnabled -eq $true -and $_.Description -match "WiFi"} | %{ | |
| $_.EnableDHCP() | |
| $_.EnableStatic($config.IPAddress, $config.Subnetmask) | |
| $_.SetGateways($config.Gateway,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-Credential | %{ | |
| $user = $_.UserName | |
| $pass = ConvertFrom-SecureString $_.Password | |
| @" | |
| <# | |
| .SYNOPSIS | |
| command with credential | |
| #> | |
| `$user = "$user" |
NewerOlder