FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SystemTools/PowerShellFs/Program.cs at master · LTRData/SystemTools · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
LTRData
/
SystemTools
Public
Notifications
You must be signed in to change notification settings
Fork
7
Star
15
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SystemTools
/
PowerShellFs
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (37 loc) · 1.21 KB
Breadcrumbs
SystemTools
/
PowerShellFs
/
Program.cs
Copy path
File metadata and controls
48 lines (37 loc) · 1.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using
DokanNet
;
using
DokanNet
.
Logging
;
using
System
;
using
System
.
Linq
;
using
System
.
Management
.
Automation
.
Runspaces
;
namespace
PowerShellFs
;
public
static
class
Program
{
public
static
void
Main
(
params
string
[
]
args
)
{
using
var
dokan
=
new
Dokan
(
new
NullLogger
(
)
)
;
RunspaceConnectionInfo
?
ci
=
null
;
if
(
args
?
.
FirstOrDefault
(
)
is
string
host
)
{
ci
=
new
WSManConnectionInfo
{
ComputerName
=
args
[
0
]
,
AuthenticationMechanism
=
AuthenticationMechanism
.
Default
}
;
}
using
var
runspace
=
ci
is
not
null
?
RunspaceFactory
.
CreateRunspace
(
ci
)
:
RunspaceFactory
.
CreateRunspace
(
)
;
var
fs
=
new
PowerShellFs
(
runspace
)
;
Console
.
CancelKeyPress
+=
(
sender
,
e
)
=>
{
dokan
.
RemoveMountPoint
(
"Q:"
)
;
e
.
Cancel
=
true
;
}
;
var
builder
=
new
DokanInstanceBuilder
(
dokan
)
;
builder
.
ConfigureOptions
(
option
=>
{
option
.
MountPoint
=
"Q:"
;
option
.
Options
=
DokanOptions
.
WriteProtection
;
}
)
;
using
var
instance
=
builder
.
Build
(
fs
)
;
instance
.
WaitForFileSystemClosed
(
uint
.
MaxValue
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL