Hey, trying to sort out a piece of scripting to remote install msi packages however every time i try i get a VMIC ReturnValue 1612 (The installation source for this product is not available. Verify that the source exists and that you can access it.)
I'm running the script from one of my DCs and that DC can without problem access the path and file i'm trying to install.
My code looks like so:
$FolderPath="\\$Computer\c$\Install\"
$SoftPath="\\Contoso.com\dfs\Programs\Deploy\7zip\"
$Installpath="$FolderPath\7zip\7z920-x64.msi"
$Product="7-Zip"
if ((Test-Path$FolderPath) -eq$false)
{
Write-Host"Creating Install Folder"
New-Item$FolderPath-ItemType Directory
}
if ((test-path$InstallPath) -eq$False)
{
Write-host"Copying Files"
Copy-Item$SoftPath$FolderPath-Recurse
Write-Host"Files Copied"
}
$Installer= [WMICLASS]“\\$Computer\ROOT\CIMV2:win32_Product”
Write-Host“Installing $Product on $Computer”
$Installer.Install(“$InstallPath”)
I don't think this is a scripting error, since it's testing paths, copying files and starting the wmi:install. I have access to both the deploy share and also to \\$computer\c$\install\7zip\7z920-x64.msi (in this particular case)
EDIT: Tried installing an exe in the same way (roughly):
And that worked like a charm. All other variables are the same as for the .msi version of the script.