PowerShell script deployment from Intune

%3CLINGO-SUB%20id%3D%22lingo-sub-1748067%22%20slang%3D%22en-US%22%3EPowerShell%20script%20deployment%20from%20Intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1748067%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20deploying%20powershell%20script%20to%20remove%20Microsoft%20store%20from%20windows%2010%20devices.%20We%20are%20using%20%22Scripts%22%20option%20in%20Intune.%26nbsp%3B%3C%2FP%3E%3CP%3ECommands%20are%20working%20fine%20manually%20but%20not%20when%20deploying%20as%20file%20from%20Intune.%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20reason%20I%20think%20is%20because%20Intune%20is%20calling%20powershell%20script%20path%20with%20%22%20%22%20and%20that's%20not%20running%20it%20properly.%3C%2FP%3E%3CP%3EWhen%20I%20tried%20to%20run%20file%20manually%20with%20%22%20%22%20it%20is%20not%20working%20but%20with%20'%20'%20it%20is%20working%20fine.%3C%2FP%3E%3CP%3ECan%20anyone%20suggest%20how%20I%20should%20proceed%20from%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1748067%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1748084%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20script%20deployment%20from%20Intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1748084%22%20slang%3D%22en-US%22%3EWithout%20seeing%20the%20actual%20script%20it's%20hard%20to%20say%20but%20you%20can%20disable%20the%20store%20natively%20in%20Intune%20without%20a%20script.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1748366%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20script%20deployment%20from%20Intune%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1748366%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F811793%22%20target%3D%22_blank%22%3E%40AdminSeanMc%3C%2FA%3E%26nbsp%3BI%20am%20using%20below%20script%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-AppxPackage%20-allusers%20*WindowsStore*%20%7C%20Remove-AppxPackage%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20please%20share%20native%20way%20to%20remove%20Store.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi All,

 

We are deploying powershell script to remove Microsoft store from windows 10 devices. We are using "Scripts" option in Intune. 

Commands are working fine manually but not when deploying as file from Intune. 

One reason I think is because Intune is calling powershell script path with " " and that's not running it properly.

When I tried to run file manually with " " it is not working but with ' ' it is working fine.

Can anyone suggest how I should proceed from here.

2 Replies
Highlighted
Without seeing the actual script it's hard to say but you can disable the store natively in Intune without a script.
Highlighted

@AdminSeanMc I am using below script:

 

Get-AppxPackage -allusers *WindowsStore* | Remove-AppxPackage

 

Can you please share native way to remove Store.