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

Powershell 2.0 and Sql server 2005 help

I am trying to figure out a way using either powershell or command line to confirm that as data base is online after I started the Database service? I find some commands out there but they don't seem...

View Article


Reply To: Code Formatting Test

Get-Process | select Id, Name

View Article


Reply To: Powershell 2.0 and Sql server 2005 help

It all depends on how you want to Connect etc. But this is an outline of how you could do it: $connectionString = "connectionstring" #open database connection to SQL Server   $conn = New-Object...

View Article

Reply To: Access Parameter in SetScript member of Script Resource in Desired...

So, I don't think your structure is right. Your Script item should contain ONLY a GetScript and TestScript section. But both of those are actually OUTSIDE your Script item. The Write-Verbose isn't in...

View Article

Reply To: Concatenation Variables Problem with extra space

That's because you're using Write-Host and passing it two parameters. "$($_.ServerName)$($blah.ShareName)" You should look into Join-Path, though. It's specifically designed for joining path components.

View Article


Reply To: SMBShare PSSessionConfoguration Error

If you limited the configuration so that it can't load PSDrives, this can happen. The shell wants to start in a directory, but if it doesn't have a drive, it can't. And the SmbShare module in...

View Article

Reply To: SMBShare PSSessionConfoguration Error

I never thought of it! I'll try it, thank you!

View Article

Reply To: Access Parameter in SetScript member of Script Resource in Desired...

ohhh. Really Sorry..its a typo mistake The Correct is… Configuration MyConfig { param($MyComputerName) Script MyScript { SetScript = { Write-Verbose "Computer Name is : $MyComputerName" } GetScript =...

View Article


Group Membership Add-Remove based on .csv

I'm attempting to add Active Directory Users to Groups. I have a file with a list of classes and Login Names. (attached) Each line in the file contains a class name (class_name) and a Login Name...

View Article


Reply To: Group Membership Add-Remove based on .csv

There are many ways to handle things. For instance, if only people in the spreadsheet are supposed to be in the group, you could just remove everyone and then run the code above. You can also do...

View Article

Reply To: Group Membership Add-Remove based on .csv

Compare-Object Edited the code as Rob Simmers import CSV example was better, this is just a different way to do the foreach loop at the bottom of his code. $ad = Get-ADGroupMember $classNameFiltered...

View Article

Reply To: Broken forum topic

Strange must be my work Computer then. I'll try it later from home! As long as it works for you I'm fine with it just thought it was weird

View Article

Reply To: service status using powershell

What also might be useful to you is: Export-Xlsx http://gallery.technet.microsoft.com/office/Export-XLSX-PowerShell-f2f0c035

View Article


Strange behavior with the Get-Alias cmdlet

Does anyone know why the following command treats the dollar sign as a wildcard instead of a literal: Get-Alias -Name ? Is there a way to use an escape character to treat the dollar sign as a literal...

View Article

Reply To: Strange behavior with the Get-Alias cmdlet

Escape it using a back tick. The cmdlet doesn't have a -LiteralName parameter.

View Article


Reply To: Strange behavior with the Get-Alias cmdlet

Same results using the back tick to escape it: Get-Alias -Name `? Looks like internally, the Name parameter of Get-Alias must do a "like" match on the value entered as the following returns the same...

View Article

Reply To: Strange behavior with the Get-Alias cmdlet

Sweet. The new code formatter works awesomely.

View Article


Image may be NSFW.
Clik here to view.

Reply To: Strange behavior with the Get-Alias cmdlet

Even the back ticks work in the new code formatter Clicking the "Preformatted" button once is all that's needed which results in "pre]{content}[/pre" being added. I replaced the content including the...

View Article

Reply To: Strange behavior with the Get-Alias cmdlet

Based on responses from @SystematicADM that I received on Twitter, both of the following work so these are ways to escape the wildcard searching and search for the literal question mark without having...

View Article

Redundancy of Code in Advanced Function

This function is something I wrote a while back and now that I'm going back through it, the following line appears to be redundant since the script wouldn't have made it to this point if $VM didn't...

View Article
Browsing all 13067 articles
Browse latest View live