Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

powershell copy-item specify credentials

$Source = "C:Downloadsmyfile.txt"
$Dest   = "10.149.12.162c$skumar"
$Username = "administrator"
$Password = ConvertTo-SecureString "Complex_Passw0rd" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential($Username, $Password)

New-PSDrive -Name J -PSProvider FileSystem -Root $Dest -Credential $mycreds -Persist
Copy-Item -Path $Source -Destination "J:myfile.txt"
Comment

PREVIOUS NEXT
Code Example
Shell :: CMake Error at src/CMakeLists.txt:10 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. 
Shell :: checking git settings 
Shell :: platformio install arduino lib 
Shell :: Unzip all zip files in a proper directory 
Shell :: pushing existing project to github 
Shell :: bcryptjs 
Shell :: comments in bash file 
Shell :: convert vmdk to qcow2 
Shell :: jupyter show digits 
Shell :: flutter markdown 
Shell :: heroku remove branch 
Shell :: luarocks 
Shell :: batch write file 
Shell :: git revert merge commit 
Shell :: reaect native reactotron 
Shell :: redis reload config 
Shell :: print value mongodb shell 
Shell :: yarn not working after install 
Shell :: linux change user password 
Shell :: restore git stash 
Shell :: delete remote commit 
Shell :: powershell clear command 
Shell :: openssl list certificate chain 
Shell :: intel pinning threads 
Shell :: set java home in ubuntu 
Shell :: why gitignore does not work 
Shell :: oh my zsh git 
Shell :: How do I revert a Git repository to a previous commit? 
Shell :: how to switch from master to main 
Shell :: move a file to /opt 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =