Thanks in advance for taking a look. I just wanted to see what someone else might do to get this working correctly. Very new to PowerShell and Python, so I am just trying to live in it right now as I work.
This script is a little side project.
function EXEversion {
$prod1 = (Get-item "Path of exe").VersionInfo.ProductVersion
$prod2 = (Get-item "Path of exe").VersionInfo.ProductVersion
$prod3 = (Get-item "Path of exe").VersionInfo.ProductVersion
$prod3 = (Get-item "Path of exe").VersionInfo.ProductVersion
$MyArray = @($prod1, $prod2, $prod3, $prod4)
See my Foreach loop below:
foreach ($item in $MyArray){
if ($item.VersionInfo.ProductVersion -eq 15.9...)
{
# Here is where my other list of functions would go that delete certain items #
}
}
elseif ($item.VersionInfo.ProductVersion -eq 16.0)
{
# Other list of functions dedicated for if this specific version is found)
}
}
Unfortunately I know my indents and format is all wrong, I am super new to PS and still learning proper format. I think I may be close, and it does work to some extent, but not correctly and not the way it needs to. Just wanted to see what someone else might do instead.
Aucun commentaire:
Enregistrer un commentaire