Feb 25, 2007
Windows PowerShell にチャレンジ (6)
サンプルスクリプトの実行
- List Basic Computer Information
- http://www.microsoft.com/technet/scriptcenter/scripts/msh/hardware/basic/hwbams01.mspx
セキュリティポリシーに引っかかってしまった(^^;PS C:\> .\ListBasicComputerInformation.ps1 File C:\ListBasicComputerInformation.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details. At line:1 char:34 + .\ListBasicComputerInformation.ps1 <<<< PS C:\>
でセキュリティポリシーをローカルのスクリプトファイルは署名無しで実行出来るように変更。PS C:\> Get-ExecutionPolicy Restricted PS C:\> Set-ExecutionPolicy RemoteSigned PS C:\>
ということで、PC の基本情報を取得することが出来た。PS C:\> .\ListBasicComputerInformation.ps1 Administrator Password Status: 3 Automatic Reset Boot Option: True Automatic Reset Capability: True Boot Option On Limit: Boot Option On WatchDog: Boot ROM Supported: True Bootup State: Normal boot (略) WakeUp Type: 7 Workgroup: PS C:\>
TrackBack ping me at
http://www.in-vitro.jp/blog/index.cgi/dotNet/20070225_01.trackback
writeback message: Ready to post a comment.
