FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


os:windows:winope:index.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
os:windows:winope:index.html [2018/02/01 23:01]
kurihara
os:windows:winope:index.html [2018/02/22 23:28]
kurihara
Line 1: Line 1:
 [[:index.html#OS Management|Top#OS Management]] [[:index.html#OS Management|Top#OS Management]]
-====== Windows Operation (winope.py)=====+====== Windows Operation with Fabric (winope.py)=====
  
 $FHHOME/fabfile/winope.py $FHHOME/fabfile/winope.py
Line 7: Line 7:
 \\ \\
  
-===== Operation =====+===== Operation with Fabric =====
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 15: Line 15:
 </sxh> </sxh>
  
-==== RefRemote Shell Commands ====+\\ 
 +==== How to Check to Use Fabric in Windows ==== 
 +<sxh bash toolbar:false gutter:false> 
 +$ ssh user01@xx.xx.xx.xx hostname 
 +</sxh> 
 + 
 +\\ 
 +==== Fabric one-line Task Examples ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="Cmd.exe /C" --no-pty -- hostname $ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="Cmd.exe /C" --no-pty -- hostname
Line 27: Line 34:
  
 <sxh python toolbar:false gutter:false> <sxh python toolbar:false gutter:false>
-import sys+import sys, os
 from fabric.api import * from fabric.api import *
 from fabric.contrib import files from fabric.contrib import files
Line 43: Line 50:
  
 #------------------------------------------------------------------ #------------------------------------------------------------------
-# winope.powershell:$PSVersionTable+# winope.powershell:'$PSVersionTable'
 #------------------------------------------------------------------ #------------------------------------------------------------------
 @task @task
 def powershell(cmd): def powershell(cmd):
-    """winope.powershell:$PSVersionTable"""+    """winope.powershell:'$PSVersionTable"""
     run("PowerShell.exe -Command %s" % cmd, shell=False, pty=False)     run("PowerShell.exe -Command %s" % cmd, shell=False, pty=False)
  


os/windows/winope/index.html.txt · Last modified: 2018/02/22 23:29 by kurihara