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\Deli veryServic esManageme nt -Name InstallDir
$dsInstallDir = $dsInstallProp.InstallDir
& $dsInstallDir\..\Scripts\I mportModul es.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\Deli veryServic esManageme nt -Name InstallDir $dsIn
stallDir = "$dsInstallProp.InstallDir & $dsInstallDir\..\Scripts\I mportModul es.ps1"
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun d,Microsof t.PowerShe ll.Command s.GetItemP ropertyCom mand
Please advise
I need to get PS working
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\Deli
$dsInstallDir = $dsInstallProp.InstallDir
& $dsInstallDir\..\Scripts\I
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\Deli
stallDir = "$dsInstallProp.InstallDir
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun
Please advise
I need to get PS working
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\Deli veryServic esManageme nt -Name InstallDir
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\Deli
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
THANK YOU
It worked!!
It worked!!
change the value to something?