Powershell script to reduce OS disk size in Azure is safe to run?

%3CLINGO-SUB%20id%3D%22lingo-sub-2157494%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20script%20to%20reduce%20OS%20disk%20size%20in%20Azure%20is%20safe%20to%20run%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2157494%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972145%22%20target%3D%22_blank%22%3E%40MSTECH20332%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EI'm%20Mouad%2C%20and%20I'm%20glad%20to%20be%20able%20help%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20a%20lookup%20in%20the%20provided%20script%20from%20github%2C%20I%20confirm%20it%20is%20safe%2C%20nothing%20harmful%2C%20but%20you%20should%20make%20a%20backup%2C%20you%20can%20go%20through%20each%20line%20of%20the%20script%20which%20is%20well%20commented%2C%20also%20all%20operations%20will%20depend%20on%20the%20parameters%20you%20pass%20without%20any%20external%20address%20or%20something%20suspicious.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20it%20helps!%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2170626%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20script%20to%20reduce%20OS%20disk%20size%20in%20Azure%20is%20safe%20to%20run%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170626%22%20slang%3D%22en-US%22%3EThanks%20for%20your%20confirmation%20and%20help.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2170776%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20script%20to%20reduce%20OS%20disk%20size%20in%20Azure%20is%20safe%20to%20run%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170776%22%20slang%3D%22en-US%22%3EIt's%20all%20my%20pleasure!%20Welcome%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2149002%22%20slang%3D%22en-US%22%3EPowershell%20script%20to%20reduce%20OS%20disk%20size%20in%20Azure%20is%20safe%20to%20run%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2149002%22%20slang%3D%22en-US%22%3E%3CP%3EHi...%20I%20am%20new%20at%20Azure%20and%20not%20familiar%20with%20PowerShell%20scripts.%20I%20found%20following%20method%20to%20reduce%20the%20OS%20disk%20size%20via%20script.%20I%20want%20to%20know%20is%20it%20safe%20and%20secure%20to%20run%20this%20script%3F%20Since%20the%20script%20seems%20granting%20some%20permissions%20(with%20admin%20rights)%2C%20any%20possible%20security%2C%20data%20theft%2Flost%20etc%20or%20any%20other%20issues%3F%20I%20just%20want%20to%20make%20sure%20script%20is%20COMPLETELY%20safe%20and%20secure%20to%20run.%3C%2FP%3E%3CP%3ELooking%20for%20kind%20feedback%20please.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fjrudlin.github.io%2F2019-08-27-shrink-azure-vm-osdisk%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fjrudlin.github.io%2F2019-08-27-shrink-azure-vm-osdisk%2F%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fjrudlin%2FAzure%2Fblob%2Fmaster%2FGeneral%2FShrink-AzDisk.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fjrudlin%2FAzure%2Fblob%2Fmaster%2FGeneral%2FShrink-AzDisk.ps1%3C%2FA%3E%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2149002%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIdentity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi... I am new at Azure and not familiar with PowerShell scripts. I found following method to reduce the OS disk size via script. I want to know is it safe and secure to run this script? Since the script seems granting some permissions (with admin rights), any possible security, data theft/lost etc or any other issues? I just want to make sure script is COMPLETELY safe and secure to run.

Looking for kind feedback please.

https://jrudlin.github.io/2019-08-27-shrink-azure-vm-osdisk/
https://github.com/jrudlin/Azure/blob/master/General/Shrink-AzDisk.ps1

Thanks.

3 Replies

Hi @MSTECH20332,

I'm Mouad, and I'm glad to be able help you.

 

I did a lookup in the provided script from github, I confirm it is safe, nothing harmful, but you should make a backup, you can go through each line of the script which is well commented, also all operations will depend on the parameters you pass without any external address or something suspicious.

 

Hope it helps! 

 
 
 
Thanks for your confirmation and help.
It's all my pleasure! Welcome