Hello.
I’m trying to invoke-command a script on a remote system using my domain admin cred but it fails to progress
$cred=get-credential
$comp=read-host “hostname”
icm -cn $comp -cred $cred -FilePath \company\global\software\Allowed_Apps\oracle\database\19c\Oracle_prep_install.ps1
\company\global\software\Allowed_Apps\oracle\database\19c\Oracle_prep_install.ps1 looks like below
#CREATE THE ORACLE DIRECTORY
Write-host “Creating Oracle directory” -foreground Green
New-Item -Path C:\Oracle -ItemType directory
#Copy files
Write-host “Copying Oracle files” -foreground Green
copy-item -verbose -Recurse \company\global\software\Allowed_Apps\oracle\database\19c*.* C:\oracle
#Unzip Oracle archive
Write-host “Extracting Oracle Install files” -foreground Green
Expand-Archive C:\Oracle\WINDOWS.X64_193000_db_home.zip -DestinationPath C:\Oracle
The script will create the C:\Oracle dir but systematically fails to copy the files if run via invoke-command with no errors. However, it will proceed if I import a pssession with the exact same admin credentials and call the Oracle_prep_install script.
What am I doing wrong ?
Thanks
G