Skip to content

Commit

Permalink
🐛 Fix compatability issues in PowerShell scrips #6
Browse files Browse the repository at this point in the history
- Added the #Requires statement to specify the minimum version of
  PowerShell that the script requires

Fixes [#6](#6)
  • Loading branch information
chriskyfung committed Nov 22, 2023
1 parent 599e28d commit 2474927
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
18 changes: 9 additions & 9 deletions Bluestacks/Optimize-BluestacksVEthernet.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#Requires -RunAsAdministrator

<#
.SYNOPSIS
Optimize Virtual Ethernet Adapter Performance for BlueStacks with Hyper-V Enabled
Expand All @@ -12,15 +10,17 @@
.OUTPUTS
None
.NOTES
Version: 1.1.3
Version: 1.1.4
Author: chriskyfung
Website: https://chriskyfung.github.io
Creation Date: 2023-03-09
Last Modified: 2023-07-01
Original from: https://gist.github.com/chriskyfung/073e0fbfeeb7b5c1e7d13dc94d638bb9
#>

#Requires -Version 3.0
#Requires -PSEdition Desktop
#Requires -RunAsAdministrator

Try {

# Disable all Virtual Ethernet Adapters except the Virtual Ethernet Adapter for BlueStacks
Expand All @@ -34,7 +34,7 @@ Try {
Disable-NetAdapterRss -Name "vEthernet (*)"
# Disable Receive segment coalescing (RSC) for all Virtual Ethernet Adapters. Learn more: https://learn.microsoft.com/en-us/windows-hardware/drivers/network/overview-of-receive-segment-coalescing
Disable-NetAdapterRsc -Name "vEthernet (*)"

# Disable specific adapter bindings on vEthernet (BluestacksNxt). Learn more: https://learn.microsoft.com/en-us/powershell/module/netadapter/disable-netadapterbinding
Disable-NetAdapterBinding -Name "vEthernet (BluestacksNxt)" -ComponentID @("ms_tcpip6", "ms_server", "ms_lltdio", "ms_rspndr")
# Set Sets the RSS properties on vEthernet (BluestacksNxt). Learn more: https://learn.microsoft.com/en-us/powershell/module/netadapter/set-netadapterrss
Expand All @@ -51,7 +51,7 @@ Try {

Write-Host "`nvEthernet (BluestacksNxt) - Receive Segment Coalescing (RSC):`n"
(Get-NetAdapterRsc -Name "vEthernet (BluestacksNxt)" | Format-List -Property "*Enabled" | Out-String).Trim()

Write-Host "`n"

} Catch {
Expand Down
2 changes: 2 additions & 0 deletions Test-URL.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#Requires -Version 3.0

$urls = @("https://www.google.com", "https://www.bing.com", "https://www.yahoo.com", "https://www.example.com")

foreach ($url in $urls) {
Expand Down
8 changes: 4 additions & 4 deletions Windows/Get-DiskReliabilityCounter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
None
.NOTES
Version: 1.0.0
Version: 1.0.1
Author: chriskyfung
Website: https://chriskyfung.github.io
Creation Date: 2023-06-24
Last Modified: 2023-06-24
#>

#Requires -Version 3.0
#Requires -PSEdition Desktop
#Requires -RunAsAdministrator

Get-Disk | ForEach-Object {
($Disk = $_) | Get-StorageReliabilityCounter |
($Disk = $_) | Get-StorageReliabilityCounter |
Select-Object DeviceId,
@{
Name="FriendlyName";
Expand Down

0 comments on commit 2474927

Please sign in to comment.