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

Next revision
Previous revision
os:windows:winope:index.html [2018/02/01 22:55]
kurihara created
os:windows:winope:index.html [2018/02/22 23:29]
kurihara [How to Check to Use Fabric in Windows]
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 
 +$ ssh user01@xx.xx.xx.xx "PowerShell.exe -Command Get-Host" 
 +</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 35:
  
 <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 51:
  
 #------------------------------------------------------------------ #------------------------------------------------------------------
-# 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)
  
  
 #------------------------------------------------------------------ #------------------------------------------------------------------
-# winope.put:+# winope.put:local, remote
 #------------------------------------------------------------------ #------------------------------------------------------------------
 @task @task
Line 60: Line 68:
  
 #------------------------------------------------------------------ #------------------------------------------------------------------
-# winope.get:+# winope.get:remote, local
 #------------------------------------------------------------------ #------------------------------------------------------------------
 @task @task


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