Solved

PowerShell command

Posted on 2014-03-28
5
710 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
This article will help you understand what HashTables are and how to use them in PowerShell.
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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