Beispiel #1
0
        public Task AttachAsync(string targetPath, string unc, SmbShareCredential smbShareCredential)
        {
            var script = $@"
$acctKey = ConvertTo-SecureString -String ""{smbShareCredential.Password}"" -AsPlainText -Force;
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList ""Azure\{smbShareCredential.Username}"", $acctKey;
New-SmbGlobalMapping -Credential $credential -RemotePath {unc};
New-Item -ItemType SymbolicLink -Path {targetPath} -Value {unc};
";

            return(cmdRunner.RunPowershell(script));
        }
 public Task <int> Exit(IExternalRunner runner, int exitCode) => runner.RunPowershell("exit " + exitCode);
 public Task <int> Echo(IExternalRunner runner, string text) => runner.RunPowershell("echo " + text);