This file contains 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 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 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 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 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 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 Where-Block | |
{ | |
[CmdletBinding()] | |
[OutputType([scriptblock])] | |
Param | |
( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[PSObject] |
This file contains 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 Where-Block | |
{ | |
[CmdletBinding()] | |
[OutputType([scriptblock])] | |
Param | |
( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[PSObject] |
This file contains 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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace IteratorTest | |
{ | |
public static class IteratorHelper | |
{ | |
//インスタンス生成を楽するためのショートカット | |
public static Iterator<T> CreateIterator<T>(params T[] source) |
This file contains 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
# このスクリプト自身が格納されているディレクトリを取得 | |
$Script:scriptDir = Split-Path $MyInvocation.MyCommand.Definition -Parent | |
<# | |
.Synopsis | |
Markdownテキストのプレビュー | |
.DESCRIPTION | |
Markdown形式で記述されたテキストファイルの内容をHTMLに変換し、ブラウザでプレビュー表示します。 | |
.EXAMPLE | |
PS C:\> Start-Markdown .\markdownText.md |
This file contains 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.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using System; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Collections.Generic; | |
namespace ConsoleApplication1 | |
{ |