Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

New-MofFile takes a path now. Added License.txt with MIT license.

  • Loading branch information...
smurawski committed Aug 27, 2013
1 parent 0fa0b97 commit 930d692d534e80bd05ee0b379b017967d137f14d
Showing with 28 additions and 4 deletions.
  1. +20 −0 LICENSE.txt
  2. +8 −4 New-MofFile.ps1
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013 PowerShell.Org

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -9,15 +9,19 @@
New-MofFile -Name Pagefile
#>
param (
$Name,
$ModuleName,
$Name,
$Version = '1.0.0'
)

if ([string]::IsNullOrEmpty($ModuleName))
$module = Import-Module $ModuleName -PassThru
$ModuleName = $Module.Name

if ([string]::IsNullOrEmpty($Name))
{
$ModuleName = $Name
$Name = $module.Name
}

#Switch MSFT_BaseResourceConfiguration to OMI_BaseResource for WMF4 and RTM
$Template = @"
[version("$Version"), FriendlyName("$Name")]
@@ -86,7 +90,7 @@ class $ModuleName : MSFT_BaseResourceConfiguration
$Template += @'
};
'@
$module = Get-Module $ModuleName

$TargetPath = join-path $Module.ModuleBase "$ModuleName.schema.mof"

if (Test-Path $TargetPath)

0 comments on commit 930d692

Please sign in to comment.
You can’t perform that action at this time.