Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVD AIB StorageSense script not working #749

Open
mvaferreira opened this issue May 30, 2023 · 5 comments
Open

AVD AIB StorageSense script not working #749

mvaferreira opened this issue May 30, 2023 · 5 comments

Comments

@mvaferreira
Copy link

mvaferreira commented May 30, 2023

Hello team, please fix the DisableStorageSense.ps1 script by moving function "Set-RegKey" to the begining of this script. It is failing with following error.

azure-arm: Set-RegKey : The term 'Set-RegKey' is not recognized as the name of a cmdlet, function, script file, or operable

I will send a pull request with the fix.

@mvaferreira
Copy link
Author

mvaferreira commented May 30, 2023

@ii-batman
Copy link

same for me
I did a blob storage script to fix this.
I am new to github and I have no idea how to submit a change to the hosted script.
If someone can help me I will post my version.

@brmcmill
Copy link

Wanted to echo, the issue is the Function for SetRegKey needs to be moved up in the script and it should execute.

https://github.com/Azure/RDS-Templates/blob/master/CustomImageTemplateScripts/CustomImageTemplateScripts_2023-09-15/DisableStorageSense.ps1

function Set-RegKey($registryPath, $registryKey, $registryValue) {
    try {
         Write-Host "*** AVD AIB CUSTOMIZER PHASE ***  Disable Storage Sense - Setting  $registryKey with value $registryValue ***"
         New-ItemProperty -Path $registryPath -Name $registryKey -Value $registryValue -PropertyType DWORD -Force -ErrorAction Stop
    }
    catch {
         Write-Host "*** AVD AIB CUSTOMIZER PHASE ***   Disable Storage Sense  - Cannot add the registry key  $registryKey *** : [$($_.Exception.Message)]"
    }
 }

The above needs to be cut/pasted right below line 10. If it's moved up there, the Set-RegKey lines should execute. I've tested it out. Please fix!

@heinrichmichael
Copy link

Issue still exist. Please move the function Set-RegKey to the top. We had to put the sript on a blob storage now as well.

@juniinacio
Copy link

Experiencing same issue in with the latest version of the script, the function must be place on the top before it can be invoke in the underlying script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants