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

How would i go about creating multiple vm's on localhost

I've been attempting to use xHyperV. I've tried the multiple nodes approach. That obviously has the flaw that it's trying to create the vm on a vm that does not exist. I've tried 1..VmCount | %{...

View Article


Reply To: -or Returning a false positive ??

Thanks guys

View Article


Reply To: How to make this more useful for my situation

Sorry Mike I quickly popped it up there as I thought it would be very helpful to other people. i have amended the description. Apologies for rushing it in the first place as I should have done it right.

View Article

Image may be NSFW.
Clik here to view.

PSCustomObject View

Hi everyone, This is my first post, but I'm really hoping you can help me out, this is driving me nuts….. When you create a cmdlet or function that outputs a...

View Article

Image may be NSFW.
Clik here to view.

Reply To: PSCustomObject View

You have to give it a custom type name. $obj.psobject.typenames.insert(0,"my.type.name") All covered in my Toolmaking book

View Article


Image may be NSFW.
Clik here to view.

Reply To: PSCustomObject View

Cheers Don, That is way simpler than Visual Studio and dll's – thanks so much!!! Trying to get time to read all your stuff – my girlfriend isn't that impressed that I've printed off the dsc book and...

View Article

Reply To: Powershell Script to Export Contacts Note

Ok now I am confused some. I tried both command to see what the output would look like. When I do ( $contacts | Get-Member -MemberType Property) I see a bunch of fields vs $contacts | Select * -First...

View Article

MOF complex types implemented?

During my research I came across this site http://msdn.microsoft.com/en-us/library/dn529073(v=vs.85).aspx explaining how to author a MOF schema file for an OData Web Service. The site does the...

View Article


Problems with "if" statement.

I cant get my if statement to work within my function. What i want it to do is check the content of a variable, the variable is content from a .csv file. I want it to check whether there is any...

View Article


Reply To: Problems with "if" statement.

I think your problem might be that you are getting the content in that variable as Get-Content instead of the Import-CSV that you call above it, I am guessing you do that just to show it, but you...

View Article

Reply To: Problems with "if" statement.

Hi Raymond, Thanks for your reply. That makes sense, i was previously trying to use clear-content and -filter to clear certain parts of the .csv but found another way to do it. That's why i was using...

View Article

Reply To: Problems with "if" statement.

Jay, I might not understand, exactly the logic you are doing, or exactly what you are looking for. From what I can gather, if you have any users in the file, you want the second block, and if no users...

View Article

Reply To: MOF complex types implemented?

Yep, take a look at xWebsite / cWebsite (https://github.com/PowerShellOrg/DSC/tree/master/Resources/cWebAdministration/DSCResources/PSHOrg_cWebsite) for an example of this. A configuration that uses...

View Article


Reply To: MOF complex types implemented?

Oh this is fantastic! It's exactly what I was looking for (I'm honestly not too sure what difference it being a complex type or not makes). This is precisely what I've been struggling with in my other...

View Article

Reply To: Problems with "if" statement.

what if you try it like this? Function Check-UserFile { [CmdletBinding()] Param( [Parameter()][String]$Path = "C:\Holding\Scripts\Starter&LeaverScripts\NewADUser.csv" )   # import-csv -path $Path...

View Article


Reply To: Problems with "if" statement.

Hi Raymond, Great thanks that worked! Maybe its my logic, i cant get my head around how it can distinguish between the headings and the content in the .csv. I thought that a .count -eq 0 wouldn't work...

View Article

Reply To: Problems with "if" statement.

I was also concerned about the ampersand char in your path

View Article


Reply To: Problems with "if" statement.

Thanks Vern, that method works too. It doesn't seem to mind the ampersand.

View Article

Reply To: MOF complex types implemented?

Hashtables and PSCredentials are special cases; DSC has some behavior specifically for those types, to make it easier on people. For an example of Hashtables in action, check out the xRemoteFile...

View Article

Reply To: Hashtable as resource parameter

I wouldn't stress too much about Get-TargetResource at this point. As far as I know, nothing ever calls it (unless you use it internally as part of the resource's Test or Set functions). Until the DSC...

View Article
Browsing all 13067 articles
Browse latest View live