# -*- coding: utf-8 -*-

name = 'create-share-file'
description = 'create share file'
args = dict(
	filename=dict(help='name of the directory', required=True),
	server=dict(help='host server', required=True),
	username=dict(help='log on as user', required=True),
	userpwd=dict(help='password for user', required=True),
	share=dict(help='share name', required=True),
)
ps = '''
$passwd = convertto-securestring -AsPlainText -Force -String %(userpwd)s
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "%(username)s@%(domain)s",$passwd
New-PSDrive -Name P -PSProvider FileSystem -Root \\\\%(server)s\\%(share)s -Credential $cred
New-Item P:\\%(filename)s -ItemType file
'''
