diff --git a/redist/Install_Update_ViGEm.ps1 b/redist/Install_Update_ViGEm.ps1 index beb83af..9cc044f 100644 --- a/redist/Install_Update_ViGEm.ps1 +++ b/redist/Install_Update_ViGEm.ps1 @@ -7,17 +7,12 @@ Break Return } -if (get-module | Where-Object {$_.Name -eq "ViGEmManagementModule"}) +if (!(Get-Module -Listavailable -Name "ViGEmManagementModule")) { - $res = Get-ViGEmBusDevice - if ($res -ne $null) - { - Get-ViGEmBusDevice | Remove-ViGEmBusDevice - } -} else { - Register-PSRepository -Name nuget.vigem.org -SourceLocation https://nuget.vigem.org/ -InstallationPolicy Trusted -force + Register-PSRepository -Name nuget.vigem.org -SourceLocation https://nuget.vigem.org/ -InstallationPolicy Trusted + Install-Module ViGEmManagementModule -Repository nuget.vigem.org } -Install-Module ViGEmManagementModule -Repository nuget.vigem.org -Install-ViGEmBusDeviceDriver -Add-ViGEmBusDevice \ No newline at end of file +Get-ViGEmBusDevice | Remove-ViGEmBusDevice +Add-ViGEmBusDevice +Install-ViGEmBusDeviceDriver \ No newline at end of file