Files
Joakim Sandström a92c69c37f A few scripts
Don't remember if this is for which manufacture name theses were, but if you know powershell you can easily changge the lnx000 to mttvdd or vice versa (this info is from memory, been awhile since i did the scripts)
2024-10-06 04:06:13 +02:00

33 lines
1.3 KiB
PowerShell

# Define the repository name and URL
$repoName = "PSGallery"
$repoUrl = "https://www.powershellgallery.com/api/v2"
# Check if the repository is registered
if (-not (Get-PSRepository -Name $repoName)) {
# Register the repository
Register-PSRepository -Name $repoName -SourceLocation $repoUrl -Confirm:$false -InformationAction:Ignore -WarningAction:SilentlyContinue
}
#Trust the repo, either its allready installed or newly added
Set-PSRepository -Name $repoName -InstallationPolicy Trusted -InformationAction:Ignore -WarningAction:SilentlyContinue
# Define the module name and version
$moduleName1 = "DisplayConfig"
$version1 = "1.1.1"
# Define the module name and version
$moduleName2 = "MonitorConfig"
$version2 = "1.0.3"
# Check if the module1 is installed
if (-not (Get-InstalledModule -Name $moduleName1 -MinimumVersion $version1)) {
# Save the module
Save-Module -Name $moduleName1 -Repository $repoName -RequiredVersion $version1 -Confirm:$false -InformationAction:Ignore -WarningAction:SilentlyContinue
}
# Check if the module2 is installed
if (-not (Get-InstalledModule -Name $moduleName2 -MinimumVersion $version2)) {
# Save the module
Save-Module -Name $moduleName2 -Repository $repoName -RequiredVersion $version2 -Confirm:$false -InformationAction:Ignore -WarningAction:SilentlyContinue
}