Solved

PowerShell command

Posted on 2014-03-28
5
701 Views
Last Modified: 2014-03-28
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
0
Comment
Question by:johnkim777
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39961504
what would you like to do?
change the value to something?
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39961869
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.
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39961893
+ $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
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39962391
I don't know what you are trying to tell us, but try this:
$dsInstallProp = Get-ItemProperty -Path HKLM:\SOFTWARE\Citrix\DeliveryServicesManagement -Name InstallDir 
$dsInstallDir = $dsInstallProp.InstallDir 
& "$dsInstallDir\..\Scripts\ImportModules.ps1" 

Open in new window

0
 

Author Closing Comment

by:johnkim777
ID: 39962852
THANK YOU
It worked!!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question