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
#1. モジュールのインポート | |
PS C:\> Import-Module path\to\posh-todo.psm1 | |
#2. ToDoデータ保存先ファイル名を指定してposh-todoを開始 | |
PS C:\> Start-PoshTodo D:\todo\myTodo.json | |
# 指定したファイル内に登録済みのToDoが存在すればその一覧が表示されます。ファイル自体が無い場合は作成されます | |
<# | |
##### ToDo List ##### | |
#> | |
# ** 上記の2行はプロファイル内に記述しておけば、毎回入力する手間が省けて良いです ** |
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 | |
Web検索 | |
.DESCRIPTION | |
Google検索を行い、検索結果リンクのタイトルとUrlを取得します | |
.EXAMPLE | |
$words = 'powerShell', 'script', 'example' | |
$words | Search-Web | |
.EXAMPLE | |
Search-Web powerShell,script,example |
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 | |
WebページからTextを取得 | |
.DESCRIPTION | |
指定したUrlのHTMLドキュメントからTextノードのみを抽出します。 | |
.EXAMPLE | |
Get-WebText "http://example.com" | |
.EXAMPLE | |
"http://example1.com","http://example2.com","http://example3.com" | Get-WebText | |
#> |
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 | |
文字列から固有表現の抽出 | |
.DESCRIPTION | |
https://labs.goo.ne.jp/ の固有表現抽出APIを使用して、文字列から固有表現を取得します | |
https://labs.goo.ne.jp/apiusage/ で取得したアプリケーションIDを $AppId パラメータに指定する必要があります。 | |
.EXAMPLE | |
Get-GooLabsEntity "今日、田中君と山本君に渋谷で待ち合わせをしています。" -AppId $app_id | |
.EXAMPLE | |
Get-Content ".\data.txt" | Get-GooLabsEntity -AppId $app_id |
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
function Get-DatePicker | |
{ | |
[CmdletBinding()] | |
[OutputType([System.DateTime])] | |
Param([string]$windowTitle=$null) | |
Add-type -AssemblyName "System.windows.forms" | |
$winForm = New-object Windows.Forms.Form | |
if([string]::IsNullOrEmpty($windowTitle)){ | |
$winForm.Text = "DatePicker Control" |
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
declare module DrawingTs { | |
class Point { | |
public x: number; | |
public y: number; | |
constructor(x: number, y: number); | |
public to(p: Point): Vector; | |
public scale(n: number): Point; | |
} | |
class Vector extends Point { | |
constructor(x: number, y: number); |
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
using Microsoft.AspNet.SignalR; | |
namespace hubProxyGen | |
{ | |
public class ChatHub : Hub<ChatHubClient> | |
{ | |
public void Send(string name, string message) | |
{ | |
Clients.All.AddNewMessageToPage(name, message); | |
} |
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
function Search-Google | |
{ | |
[CmdletBinding()] | |
Param( | |
# 検索ワード | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[PSObject[]] | |
$SearchWords |
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
# TabExpansion++ を使用する場合 | |
function GoogleSuggestCompletion { | |
# この属性でターゲットとなるコマンドとパラメータを指定する | |
[ArgumentCompleter( | |
Parameter = 'SearchWords', | |
Command = 'Search-Google', | |
Description='TabExpansion++ Argument Completer for Search-Google')] | |
# 入力パラメータこの通りにする。$wordToComplete に入力中の値が入ってくる。 | |
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) |
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
using Microsoft.Diagnostics.Tracing; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
using System.Management.Automation; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Threading; | |
namespace EtwStream.PowerShell |