Skip to content

Instantly share code, notes, and snippets.

@atosimitu
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atosimitu/9ab1375fc408f28fa494 to your computer and use it in GitHub Desktop.
Save atosimitu/9ab1375fc408f28fa494 to your computer and use it in GitHub Desktop.

PowerShell(Windows10)

参考情報

https://technet.microsoft.com/en-us/scriptcenter/default
https://github.com/guitarrapc/PowerShellUtil
http://tech.guitarrapc.com/

$PSVersionTable

Version情報、Windows10はVersion5.0

#requiresステートメント

必要なバージョンを指定できる
どこに記述してもいいので、先頭行がわかりやすい。

#requires -version 5.0

about_Comment_Based_Help

https://technet.microsoft.com/en-us/library/hh847834.aspx
aboutコマンド

Update-Help

https://technet.microsoft.com/en-us/library/hh849720.aspx
Help情報アップデート(管理者権限)

Install-Module(PowerShellGet

http://tech.guitarrapc.com/entry/2015/07/04/163454
https://msconfiggallery.cloudapp.net/
初回にNuGet-anycpu.exeをダウンロードするか聞かれる。

#requires -version 5.0
Find-Module #Search through modules in the Gallery with 
Save-Module #SSave modules to your system from the Gallery with 
Install-Module #SInstall modules from the Gallery with 
Update-Module #SUpdate your modules to the latest version with 
Register-PSRepository #SAdd your own custom repository with 
Get-InstalledModule

Pester

#requires -version 5.0
Install-Module Pester

Get-Credential

http://tech.guitarrapc.com/entry/2014/01/14/101056

Get-NetIPAddress

ipconfig

Test-Connection

Pingコマンド

#requires -version 2.0
Test-Connection -ComputerName 192.168.0.1

Test-NetConnection

Pingコマンド(Port指定可)

Test-NetConnection -ComputerName 192.168.0.1 -Port RDP
Test-NetConnection -ComputerName 192.168.0.1 -Port 80

Measure-Command

https://technet.microsoft.com/ja-jp/library/Ee176899.aspx

Measure-Command {1..1000 | %{Get-Date}}

Invoke-WebRequest

curl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment