Link to home
Start Free TrialLog in
Avatar of johnkim777
johnkim777

asked on

PowerShell command

Hi,
I'm trying to execute below PS command, posted on http://blogs.citrix.com/2014/03/27/hiding-applications-in-citrix-storefront/#comment-134229

$dsInstallProp = Get-ItemProperty `
 -Path HKLM:\SOFTWARE\Citrix\DeliveryServicesManagement -Name InstallDir
$dsInstallDir = $dsInstallProp.InstallDir
& $dsInstallDir\..\Scripts\ImportModules.ps1

I'm getting all sorts of errors such as
1. Ampersand not allowed
2. Get-ItemProperty : A positional parameter cannot be found that accepts argument 'C:\Program Files\Citrix\Receiver Store
Front\Management\'.
At line:1 char:34
+ $dsInstallProp = Get-ItemProperty <<<<  -Path HKLM:\SOFTWARE\Citrix\DeliveryServicesManagement -Name InstallDir $dsIn
stallDir = "$dsInstallProp.InstallDir & $dsInstallDir\..\Scripts\ImportModules.ps1"
    + CategoryInfo          : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

Please advise
I need to get PS working
Avatar of Justin Yeung
Justin Yeung
Flag of United States of America image

what would you like to do?
change the value to something?
Obviously your carriage returns are not correct, and the commands are joined together into a single line. Make sure you use an editor like Notepad using correct line breaks for the ps1 file.
+ $dsInstallProp = Get-ItemProperty <<<<  -Path

indiated the error here..........

TAKE ` AWAY AND MOVE IT TO THE SAME LINE...... OR PLACE ` BACK AFTER IT FOR CONTINUE NEXT LINE

$dsInstallProp = Get-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DeliveryServicesManagement -Name InstallDir
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnkim777
johnkim777

ASKER

THANK YOU
It worked!!