Quantcast
Channel: PowerShell.org » All Posts
Browsing all 13067 articles
Browse latest View live

Reply To: Newbie with Copy question

Copy-Item -Path "C:\MyFile.txt" -Destination "\\ED0000400005409\c$\Users\GSinger\Desktop "

View Article


Reply To: Newbie with Copy question

Fantastic, I used the command as Rob Simmers posted it and it worked perfectly. Thank you so much.I got tired of tryong to figure that one out and finally had to just break down and ask

View Article


Reply To: Add registry key

The problem is that I would like to overcome the error "" The execution of scripts is disabled on your system. " It only works if I start, first and manually, Powershell in "run as administrator" I...

View Article

Command to know if a file is open on the network

Hi, I've created a script that loads three Excel files to three variables into PowerShell to make some queries (the three files are on a network path). Is there a way to see if those files are open by...

View Article

Reply To: Sharepoint 2010 Remote Admin

Thank for the response. I will check out those links. I'm curious why you think it is a double hop problem. I am remoting directly into the SharePoint server. Is the second hop the database server?

View Article


Reply To: Command to know if a file is open on the network

You can use openfiles tool to check on open files from the CMD or POWERSHELL try this: openfiles /query if you get a message like The system global flag 'maintain objects list' needs to be enabled to...

View Article

Reply To: Command to know if a file is open on the network

If you are only doing queries, you can force Word to open in read-only mode and you don't need to validate if the documents are open. The MSDN documentation is here:...

View Article

Reply To: Sharepoint 2010 Remote Admin

The second hop could be your database server. I don't know your environment of course.

View Article


Reply To: Add registry key

I think you don't need to modify the registry value directly. Two easy options: 1. Use a Group Policy to set the PowerShell execution policy for all machines. 2. Invoke-Command -ComputerName client1,...

View Article


Reply To: Add registry key

Unfortunately PCs are in remote locations and not on the same LAN. The first method can be applied using a script? The method 2 is applicable on PCs that are outside the LAN? They are not in the...

View Article

Reply To: Command to know if a file is open on the network

This may be more of what you're looking for: function TestFileLock ($FilePath ){ $FileLocked = $false $FileInfo = New-Object System.IO.FileInfo $FilePath trap {Set-Variable -name Filelocked -value...

View Article

Capture cmdlet progress bars

I'm working on making a GUI for some winPE stuff to make it easier on our system admins. Right now I have the basic ps script working well. When I execute the dism cmdlets, a progress bar pops up in...

View Article

Reply To: Add registry key

In this way it works: Set-ExecutionPolicy RemoteSigned –Scope CurrentUser -Force $args = @' powershell.exe -Command { set-ItemProperty -Path...

View Article


Reply To: Capture cmdlet progress bars

Can you provide a more specific example with the cmdlets that are producing the progress bars? You can probably show no progress and generate your own progress in the form. Another question is if you...

View Article

Replacing csv header row

I'm trying to automate an ad import using an unedited csv file nightly. The problem is the data base I am exporting from has its own headers. Is it possible to replace the entire header row with...

View Article


Reply To: Replacing csv header row

Sure. There are a couple of ways to go about that; I prefer to import the old CSV file, then use Select-Object to change the property names of objects in memory, and export back to CSV with the new...

View Article

Reply To: Capture cmdlet progress bars

Well, you should be able to prevent the default progress bars from popping up by setting the $ProgressPreference variable to SilentlyContinue. However, getting the data into your own form would depend...

View Article


Reply To: PSRemoting – PSSessionConfiguration – Using PSSnapin in...

Are you sure the snapin is appropriately installed on the machine to which you're remoting? The first error was: The specified module 'WDeploySnapin3.0' was not loaded because no valid module file was...

View Article

Reply To: Replacing csv header row

I typically build a custom psobject and fill it with the desired property names and values before exporting to CSV. Don't know if it's applicable in your specific case though. $result = foreach($item...

View Article

Reply To: Capture cmdlet progress bars

Not sure what to tell you. If you search for "PowerShell Progress Stream", you'll find all sorts of examples that use the approach I mentioned, using the S.M.A. PowerShell object, then monitoring its...

View Article
Browsing all 13067 articles
Browse latest View live