Hi all,
I have new to PS and trying to run a powershell command, which is giving me error. Please let me know what I am missing here. I am having trouble to run the script to create folders and collections
PS E:\> dir SCCMTools\powershellscripts\createfoldersandcollections.ps1> Set-ExecutionPolicy RemoteSigned
Get-ChildItem : A positional parameter cannot be found that accepts argument 'RemoteSigned'.
At line:1 char:4
+ dir <<<< SCCMTools\powershellscripts\createfoldersandcollections.ps1> Set-ExecutionPolicy RemoteSigned
+ CategoryInfo : InvalidArgument: ([Get-ChildItem], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
PS E:\>
----
I think the issue with the .ps1 but I am not sure what will be the work around.
When I run this without .ps1, it gives me the below error
PS E:\SCCMTools> dir powershellscripts\CreateFoldersAndCollections
Get-ChildItem : Cannot find path 'E:\SCCMTools\powershellscripts\CreateFoldersAndCollections' because it does not exist
.
At line:1 char:4
+ dir <<<< powershellscripts\CreateFoldersAndCollections
+ CategoryInfo : ObjectNotFound: (E:\SCCMTools\po...sAndCollections:String) [Get-ChildItem], ItemNotFound
Exception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand