Quantcast
Channel: PowerShell General
Browsing all 10624 articles
Browse latest View live

convert Text to objects

My PowerShell skills are very limited and I was hoping to get some help.  I need to convert output text from a legacy CLI tool into objects so that I can better utilize Powershell's capabilities.  The...

View Article


Copy-toZip Woes

Im back again, I have been working with many variations of copy-to zip using  for-each($_. in $Variable) Copy-tozip...dir C:\Photos\*.JPG | Copy-ToZip -ZipFile C:\Photos2Looks to be the simplest method...

View Article


What am I doing wrong?

I have created this migration script for a Win7 deployment.  It takes a parameter "-site" and then does a few things on the way to creating folders. It doesnt seem to like the paramter input.  Also, i...

View Article

Invoke-Expression? Sort? Building a script for MDT application replacement...

Hi. I did some searching through the forums. I've been working on this for 3 days. I'm somewhat of a noob to powershell.   The script is to run as an MDT task and reads a file(List of old programs.txt)...

View Article

can't match "\" at end of string

I have been trying to match the "\" at the end of string and it comes up false"Scripts\" -match '$\\'      returns False"Scripts\" -match "\Z\\"   returns Falsecan someone tell me the right syntax for...

View Article


Logical Constructs Question

I am not a programmer at all, but I do want to be able to write my own scripts to make my admin life a bit easier. So, I am now into chapter 3 of Mr. Jones's TollMaker book. I have always had issues...

View Article

PowerShell - Email notification for failure of batch

Hi I am new to PS.I am executing SQL scripts via a batch file.  PowerShell correctly exits the batch when a script fails.  When that occurs I would like to send an email, or if no error occurs send...

View Article

POSH script or function how to add get-credentials?

Howdy All! How can I add something to function to get prompted for credentials?Here's what I've started, the function works but I don't know where to put the credentials part. I did add in the...

View Article


And a new member to an existent array

Good morning,Here i have a little script I wrote.cls$Date_Time = $(Get-Date -format g)$Computers = Import-csv "Computers.csv"$File = "Exported_File.csv"$report = @()foreach ($Computer in $Computers){...

View Article


Adding to a CSV in a loop

I was trying to throw together a quick script earlier to watch the resource use of some IE instances on a machine.  I needed the script to keep logging until I told it to stop. Rather than just...

View Article

Move and rename a lot of files

I need to do a daily sweep of a folder to see if any file(s) have been put into it.  If there is a file I need to move it to another location and add the current date and time to the original file...

View Article

Math or string wrong in script help!

The script below is suppose to query the recommended page file size and compare it to the current page file size. If I set the page file size it always says it is wrong because of the math in this...

View Article

Get-Counter is not working on remote server with different credentials

Get-Counter is not working on remote server with different credentials.

View Article


Parameterizing Scripts

I am just learning the art of "Tool Making" Don Jones book, chapter 4. I am posting this code for review and I hope it passes the formating industry standards, if not tell whats wrong and I will surely...

View Article

Trying to populate a CSV with drive info

Hi All - this seems so simple, but I cannot seem to get the output from this tiny script to show up in a CSV like it does on the host. I know I am looking at an output formatting issue, but that always...

View Article


Restart server & then email

I am trying to write a script to restart a server and then email when the restart is done.I started with this basic command:  Restart-Computer -ComputerName <string[ ]>,But I can't get it into a...

View Article

Image may be NSFW.
Clik here to view.

Script to Create OLEDB Connection

Need help in establishing OLEDB connection to the database, i am using the below script to connect to a oracle database, When i run the script the output is not showing all the records/ data. Enclosed...

View Article


File migration

Hey all. I am looking to separate some files for a mail migration. We have several PST files per user that are grouped together in each user subfolder. We need to separate the PST files based on...

View Article

Install software with powershell

Hi All,I am trying to build a script which would install some softwares one  after the other. As the exe's cannot be tuned to use with powershell, I am using something like this, invoke-expression,...

View Article

Script for file update on two storage location

 I want to run a script for file update on two storage location. Currently I am running a copy script from Server1 to Storage1 & 2. So if anybody put any doc file on server1 it’s automatically get...

View Article
Browsing all 10624 articles
Browse latest View live