汎用機メモっとくか

しごと用の(学習メモ&お気に入り保存)。

でっきるかな?PowerShell 000

2015年04月03日 02時33分49秒 | PowerShell

でっきるかな?PowerShellその000

Windowsと付き合っていくには、覚えた方が良いツール
XPにはインストールが必要。

C:\WINDOWS\system32\windowspowershell\v1.0\examples
profile.ps1
を見とく

とりあえず、こんなのからも動かせる。
やたら壊れますが...

<console_ps.cmd>
rem PATH="C:\WINDOWS\system32\windowspowershell\v1.0"
@echo off

subst P: "%CD%"
P:
powershell.exe

subst /D P:

<バージョン確認>
http://win.just4fun.biz/PowerShell/PowerShell%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%83%BB$PSVersionTable.html

C:\Documents and Settings\USER\デスクトップ>rem PATH="C:\WINDOWS\system32\windowspowershell\v1.0"
Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. All rights reserved.

PS P:\> $host


Name : ConsoleHost
Version : 1.0.0.0
InstanceId : a70f24d9-a24d-4533-8feb-2b16a5713e71
UI : System.Management.Automation.Internal.Host.InternalHostUserI
nterface
CurrentCulture : ja-JP
CurrentUICulture : ja-JP
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy

 

PS P:\>

<powershellのHELP>
PS P:\> powershell /? >help_powershell.txt

コマンド類は、get-helpで見る

 

<20150622STA>
「 Linux ならできるのに、だから Windows は...」「それ PowerShell でできるよ」様
http://qiita.com/cd01/items/da9a36582372e7d0a7f6

 

<PS_ISE.vbs>
Option Explicit
    Dim oShell
    Dim PATH_CMD
   
    PATH_CMD   = "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell_ise.exe"
    Set oShell = WScript.CreateObject("WScript.Shell")
   
    Dim oExec
    Set oExec = oShell.Exec(PATH_CMD)
   
    Set oShell = Nothing
    Set oExec = Nothing

 

<20150622END>