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

Reply To: pssnapin question and OneNote

Hi Joe, OneNote doesn't come with a PowerShell provider. You'll need to install Brian's MSI because snap-ins need to be registered in the Registry unlike modules. Brian's MSI should handle the...

View Article


Reply To: Deleting Old User Profiles

Deleting user profiles is a tricky business. I believe PowerShell is not the right tool for the job. We're using Helge Klein's Delprof2 tool at work which does exactly this job very well without issues.

View Article


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

On the other hand, if you create a module of your own $snapin = Get-PSSnapin -Registered WDeploySnapin3.0 Import-Module (Join-Path $snapin.ApplicationBase $snapin.ModuleName) -Verbose...

View Article

Reply To: Event log script help.

Hi Again, I'm still having a lot of trouble with one of these scripts. Now the strange thing is even though the $date variable is used twice this script has been working fine for over a year. It takes...

View Article

Reply To: $Allnodes.foreach examples

thanks Jacob much appreciated, hopefully the example below shows what we are trying to do. At the moment we are using just a standard foreach() statement and just enumerating through the windows...

View Article


Reply To: View Past Powershell Scripts

Thanks Daniel. no shares or repositories and i was hoping to build my code from their examples …. oh well !

View Article

Reply To: passing on variables

thanks very much, i replaced that line with "$pathd = $path -replace $user" and my script works fine, many thanks again

View Article

Executing Powershell from C#

I know the C# element of this is OT here but I am at a loss and am hopeful someone with more powershell experience than I may know something. I have tried several ways to loop through some code with...

View Article


Reply To: Executing Powershell from C#

We probably need to see what you've already attempted, but in general, PowerShell is very slow compared to C#. If performance is a concern, since you're in a C# app anyway, you may find that it's...

View Article


Finding Hyperlinks in word documents then attaching the document

Hey, Im creating a powershell script to search through word documents for hyperlinks. Here is what I would like to achive – Search through the word document Find the hyperlinks obtain the hyperlink...

View Article

Reply To: Adding multiple bindings with xWebAdministration

The below worked for me: $sitename = "MainWebSite" xWebsite MainHTTPWebsite { Ensure = "Present" Name = $sitename ApplicationPool = "MainAppPool" State = "Started" PhysicalPath = "C:\path\to\files"...

View Article

Reply To: Executing Powershell from C#

Hi Dave, I have basically moved the following into and out of the loop that iterates of the data set: Collection&ltPSObject&gt results; using (PowerShell powerShell = PowerShell.Create()) { //...

View Article

Reply To: $Allnodes.foreach examples

I will have to test this out and get back to you. What happens when you run this? Do you get a .MOF file, an error message, or something else? I am just wanting to know what kind of behavior you are...

View Article


Reply To: Deleting Old User Profiles

Just so you understand the problem with your script. You are generating a PSObject from Get-WMIObject, so the object doesn't have a .Delete() method (even if it did, it would just manipulate the...

View Article

Reply To: $Allnodes.foreach examples

Alright, it's going to take someone with a much greater understanding of PowerShell than me to tell you how to do this. It is definitely supported, because if you just type Node $AllNodes. you get 2...

View Article


Reply To: Finding Hyperlinks in word documents then attaching the document

Working with Office products using COM+ is an adventure. The good thing is you can get a hint of what you're doing using the macro recorder. Enable the developer tab on the ribbon. Start recording a...

View Article

Reply To: $Allnodes.foreach examples

Basically Is it possible to use the $Allnodes.Foreach() statement in a similar fashion but using the array stored in the hash table key Winfeatures within the configdata and do something like...

View Article


Reply To: Executing Powershell from C#

Well, that's the basics of how to execute PowerShell from within C#. However, if you're doing this millions of times, you may find that it's much faster to run the script once, keep an open runspace,...

View Article

Reply To: Event log script help.

ReplacementStrings: http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlogentry.replacementstrings(v=vs.110).aspx The replacement strings are returned as a array, so the [#] indicates the...

View Article

Reply To: Deleting Old User Profiles

Thx Rob I'm going to check it out ill let you know

View Article
Browsing all 13067 articles
Browse latest View live