SHARE
TWEET

Untitled

a guest May 27th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try {
  2.     #「Windows PowerShell資格情報の要求」ダイアログが表示され、ユーザ名・パスワードを入力する。
  3.     $oCred = Get-Credential -Credential $env:username.ToUppser()
  4. } catch {
  5.     # キャンセルボタンが押された
  6.     exit 1
  7. }
  8.  
  9. # 「username」と入力すると「\username 」の形で戻るので1文字目を読み飛ばす
  10. $sUser = $oCred.UserName.Substring(1)
  11. $sPass = $oCred.GetNetworkCredential().Password
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top