I need a script to run on Vista Ultimate to share an external drive and assign full control to Everyone. I've got a batch file to create the share using net share, but there doesn't seem to be a way to change the permissions. I reckon this must be possible in PowerShell, but I have no idea where to start.
...
How do I market a new open source project using .NET and PowerShell? The project has taken me around a years effort to get near completion, I'd appreciate some hints on how to get the word out.
...
Is it possible to use PowerShell to script out SQL Server Reporting Services rdl files in SQL Server 2008? If so, can someone provide a code example of doing this? This would be a useful replacement for using a 3rd party tool to script out RDL files created by business users outside of my Business Intelligence department.
CLARIFICATIO...
In my output, I get
@{ActiveSyncEnabled=False}
how do I parse this so that it just says "False"?
the output is coming from this line of code:
$pda = get-casmailbox -Anr $user.displayname | select activesyncenabled
...
how do you run the cmdlet "get-mailbox" outside the current default scope of the current domain?
When I run get-mailbox -OrganizationalUnit bob.com/bobsage
I get an error message saying:
Get-mailbox: The requested search root 'rss.com/rsstoilet' is not in the current default scope 'ens.com'. Cannot perform searches outside the current d...
Hello.
I'm parsing simple (no sections) INI file in PowerShell. Here code I've came up with, is there any way to simplify it?
convertfrom-stringdata -StringData ( `
get-content .\deploy.ini `
| foreach-object `
-Begin { $total = "" } `
{ $total += "`n" + $_.ToString() } `
-End { $total } `
).Replace("\", "\\")
...
I'm looking to learn Windows PowerShell. Can someone give me some really good references on where to start?
...
I've done several Google searches and can't find a good sample to stop/start the 'Default Web Site' (in II6) using Powershell.
This...
$server = "localhost"
$siteName = "default web site"
$iis = [ADSI]"IIS://$server/W3SVC"
$site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer"
-AND $_.ServerComment -eq $siteNam...
Background
this post explains how one can consume extension methods in Powershell
http://community.bartdesmet.net/blogs/bart/archive/2007/09/06/extension-methods-in-windows-powershell.aspx
Compare this to what someone does in C# - they add a "using SomeAssembly" and all the extension methods are loaded.
My questions
Did this get sim...
Redirecting command output:
eg:
echo "Foo `./print_5_As.rb`"
would echo "Foo AAAAA"
Thanks
...
PS C:\Projects>
get-childitem -recurse
| where { $_.Extension -eq ".csproj" }
| foreach { Get-Content $_.FullName
| foreach { $_.Length } }
This prints the line size of every line in a csproj (pretty pointless true). How can I also output a outer variable (so to speak) when I've dived further. So for example le...
UPDATE (solution)
Months later someone turned me on to an awesome solution to this. If you install Git for Windows, it comes with this console app called Git Bash that does exactly what I descibed. I gather that it is derived from MinGW. It's easy and convenient and gives you all the Unix bash command line conveniences. Tab-completion w...
How can I generate a assembly qualified type name?
For an example, when configuring a membership provider, I would have to provide a assembly qualified type name for "SqlMembershipProvider" (in this example, i have copied the below configuration from somewhere) in "type" attribute.
How do you generate that assembly qualified type name?...
Hi,
I'm currently putting together some Powershell cmdlets. Building them is easy enough but I don't know if I'm building them in an acceptable manner (so to speak).
Are there any guidelines/best practices that one should follow for passing data into the Powershell pipeline? At the moment I'm actually output a single object of type Data...
It appears that I can escape command line arguments using single or double quotes:
PS C:\> echo Hello World
Hello
World
PS C:\> echo 'Hello World'
Hello World
PS C:\> echo "Hello World"
Hello World
But there's still something I can't figure out, which is when you wish to run an executable from a directory that contains a space in it:
...
I'm trying to run the get-service command on a remote machine in powershell. After doing some research, it appears this is only possilbe n powershell 2 CTP, which I cannot use as I need to use the version of powershell installed with exchange, which is usualy 1. It seems the -computerName switch is only availible in get-service in ps 2....
I have two PowerShell functions, the first of which invokes the second. They both take N arguments, and one of them is defined to simply add a flag and invoke the other. Here are example definitions:
function inner
{
foreach( $arg in $args )
{
# do some stuff
}
}
function outer
{
inner --flag $args
}
Usage would loo...
The $args variable should, by definition, contain all arguments passed to a script function. However if I construct a pipeline inside my function, the $args variable evaluates to null. Anyone knows why?
See this example:
function test { 1..3 | % { echo "args inside pipeline: $args" } ; echo "args outside pipeline: $args" }
This is th...
Is it possible to hook a custom dialog into the new PowerShell ISE (Integrated Scripting Environment) that replaces the existing .NET WinForms dialog. I am talking about the dialog that the Read-Host cmdlet launches to request for user input.
...
Hello,
I'm trying to modify the contents of an MSI file using Powershell. To do so I create an instance of a WindowsInstaller.Installer then use $installer.OpenDatabase and $database.OpenView. Similar functionality works in VBScript and I've seen samples on-line that appear to work.
$installer = new-object -comobject "WindowsInstalle...