Help with PowerShell Script for Deleting Network Profiles

0
10
Asked By CuriousCat23 On

Hi there! I found a resource while searching for a PowerShell script to delete specific known networks and block access to them on managed devices. I can run individual `netsh wlan` commands in PowerShell without issues, but when I attempt to run the script below, I'm getting an error that says one or more parameters for the command are not correct or missing. Here's the script I've been using:

```powershell
$PackageName = "Block-Wi-Fi-SSID"
$Path_local = "C:ProgramDataMicrosoftIntuneManagementExtensionLogs"
Start-Transcript -Path "$Path_local$PackageName-install.log" -Force
netsh wlan delete profile name=22Company Guest22 i=*
netsh wlan delete profile name=22Company WiFi22 i=*
netsh wlan add filter permission=block ssid=22Company Guest22 networktype=infrastructure
Stop-Transcript
```

Any insights on what might be going wrong? Thanks!

1 Answer

Answered By TechWhiz47 On

It looks like the issue might be with the quotes you've used. Make sure you replace any fancy quotes with the standard `"` in your commands. Programming languages are particular about syntax, and those curly quotes can trip you up!

YouCodingItWrong -

Could you show an example of how I should format those quotes? I'm not following exactly.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.