Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Obtain directory listing of powershell scripts ... then execute powershell scripts in directory

$
0
0

I'ver been banging my head on this powershell script I am working on, not sure what it is I am missing.

What I'm trying to do is get a directory listing of powershell scripts I created and then execute them.

So far I have tried the following:

# Titanium Graph Generation
$TitaniumGraphUpdates = Resolve-Path ..\*.ps1

foreach ($Name in $TitaniumGraphUpdates)
    {
    Write-Host executing the following .. $Name.Path  

    Invoke-Expression (start powershell (($Name.Path )))
    }

 

What am I missing? another option I was trying was to export the directory to csv import but still unable to execute those scripts.

Any advice or pointers would be greatly appreciated.


Viewing all articles
Browse latest Browse all 6937

Trending Articles