PS Script to PrimalForms 2011

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 11 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
PBilat
Posts: 7
Last visit: Tue Dec 19, 2017 1:09 am

PS Script to PrimalForms 2011

Post by PBilat »

Hello everybody I use this PS Script to search Group Policy Settings. Can somebody help me to create a PrimalForms with all the PS Script content PS Script and details:

<#

.Synopsis


Searches text files by pattern and displays the results.

.Description


Searches text files by pattern and displays the results.

.Notes

Based
on versions from http://weblogs.asp.net/whaggard/archive ... utput.aspx
and from http://poshcode.org/426



Makes
use of Out-ColorMatchInfo found at http://poshcode.org/1095.

#>



#requires
-version 2

param
(


[Parameter(Mandatory=$true)]


[regex] $pattern,


# [string] $folderpath = (Read-Host "Please enter folder to
check","Ex. C:TestsGPOReports"),


[string] $folderpath = "C:TestsGPOReports",


# [string] $filter = (Read-Host "Please insert the
File-Extension","Ex. *.HTML"),


[string] $filter = "*.HTML",


[switch] $recurse = $true,


[switch] $caseSensitive = $false,


[int[]] $context = 0

)



if
((-not $caseSensitive) -and (-not $pattern.Options -match
"IgnoreCase")) {


$pattern = New-Object regex
$pattern.ToString(),@($pattern.Options,"IgnoreCase")

}



#
Output as "Out-GridView"

Get-ChildItem
-Path:$folderpath -recurse:$recurse -filter:$filter | Select-String
-caseSensitive:$caseSensitive -pattern:$pattern -AllMatches -context $context |
Out-Gridview



#
Output as "CSV-File"

#
Get-ChildItem -Path:$folderpath -recurse:$recurse -filter:$filter |
Select-String -caseSensitive:$caseSensitive -pattern:$pattern -AllMatches
-context $context | Export-CSV -path C:TestsGPOSearch-Result.csv
-notypeinformation -Delimiter ';' -Encoding 'ASCII'



#
Output as "Format-Talbe"

#
Get-ChildItem -Path:$folderpath -recurse:$recurse -filter:$filter |
Select-String -caseSensitive:$caseSensitive -pattern:$pattern -AllMatches
-context $context | Format-Table LineNumber, Line, Filename, Path -Wrap |
Out-File C:TestsGPOResult.txt

#
Invoke-Item C:TestsGPOResult.txt







General
information:

When the
Administrator start the PS script, a popup windows appears in which the Admin
must insert the desire
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

PS Script to PrimalForms 2011

Post by Alexander Riedel »

Our sister site www.scriptinganswers.com would be the place for these types of questions.
davidc2012-08-03 13:56:10
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 11 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.